OfficeIMO

API Reference

Class

WordStructuredDocumentTag

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents a structured document tag (content control) within a Word document.

Inheritance

Constructors

WordStructuredDocumentTag 2 overloads
public WordStructuredDocumentTag(WordDocument document, Paragraph paragraph, SdtRun stdRun) #

Initializes a new instance of the WordStructuredDocumentTag class.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
Parent document.
paragraph DocumentFormat.OpenXml.Wordprocessing.Paragraph requiredposition: 1
Paragraph that contains the content control.
stdRun DocumentFormat.OpenXml.Wordprocessing.SdtRun requiredposition: 2
Underlying structured document run.
public WordStructuredDocumentTag(WordDocument document, SdtBlock sdtBlock) #

Initializes a new instance from a structured document block.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
Parent document.
sdtBlock DocumentFormat.OpenXml.Wordprocessing.SdtBlock requiredposition: 1
Structured document block.

Methods

public Void Remove() #
Returns: Void

Removes the structured document tag from the document.

public WordStructuredDocumentTag SetBold(Boolean isBold = true) #
Returns: WordStructuredDocumentTag

Sets the content control text to bold and returns the instance for chaining.

Parameters

isBold System.Boolean = true optionalposition: 0
Whether the text should be bold.
public WordStructuredDocumentTag SetColor(Nullable<Color> color) #
Returns: WordStructuredDocumentTag

Sets the text color and returns the instance for chaining.

Parameters

color System.Nullable{SixLabors.ImageSharp.Color} requiredposition: 0
Text color, or null to clear.
public WordStructuredDocumentTag SetColorHex(String color) #
Returns: WordStructuredDocumentTag

Sets the text color using a hexadecimal value and returns the instance for chaining.

Parameters

color System.String requiredposition: 0
Color in hexadecimal format.
public WordStructuredDocumentTag SetFontFamily(String fontFamily) #
Returns: WordStructuredDocumentTag

Sets the font family and returns the instance for chaining.

Parameters

fontFamily System.String requiredposition: 0
Name of the font family.
public WordStructuredDocumentTag SetFontSize(Int32 fontSize) #
Returns: WordStructuredDocumentTag

Sets the font size in points and returns the instance for chaining.

Parameters

fontSize System.Int32 requiredposition: 0
Font size in points.
public WordStructuredDocumentTag SetHighlight(Nullable<HighlightColorValues> highlight) #
Returns: WordStructuredDocumentTag

Sets the highlight color and returns the instance for chaining.

Parameters

highlight System.Nullable{DocumentFormat.OpenXml.Wordprocessing.HighlightColorValues} requiredposition: 0
Highlight color, or null to clear.
public WordStructuredDocumentTag SetItalic(Boolean isItalic = true) #
Returns: WordStructuredDocumentTag

Sets the content control text to italic and returns the instance for chaining.

Parameters

isItalic System.Boolean = true optionalposition: 0
Whether the text should be italic.
public WordStructuredDocumentTag SetUnderline(Nullable<UnderlineValues> underline) #
Returns: WordStructuredDocumentTag

Sets the underline style and returns the instance for chaining.

Parameters

underline System.Nullable{DocumentFormat.OpenXml.Wordprocessing.UnderlineValues} requiredposition: 0
Underline style, or null to clear.

Properties

public String Alias { get; } #

Gets the alias associated with this content control.

public String Tag { get; set; } #

Gets or sets the tag value for this content control.

public String Text { get; set; } #

Gets or sets the inner text of the content control.

public Boolean Bold { get; set; } #

Gets or sets a value indicating whether the content control text is bold.

public Boolean Italic { get; set; } #

Gets or sets a value indicating whether the content control text is italic.

public Nullable<UnderlineValues> Underline { get; set; } #

Gets or sets the underline style for the content control text.

public Nullable<Int32> FontSize { get; set; } #

Gets or sets the font size in points for the content control text.

public String FontFamily { get; set; } #

Gets or sets the font family for the content control text.

public Nullable<Color> Color { get; set; } #

Gets or sets the text color using Color.

public String ColorHex { get; set; } #

Gets or sets the text color as a hexadecimal string.

public Nullable<HighlightColorValues> Highlight { get; set; } #

Gets or sets the highlight color applied to the content control text.