API Reference
WordStructuredDocumentTag
Represents a structured document tag (content control) within a Word document.
Inheritance
- WordElement
- WordStructuredDocumentTag
Constructors
public WordStructuredDocumentTag(WordDocument document, Paragraph paragraph, SdtRun stdRun) #Initializes a new instance of the WordStructuredDocumentTag class.
Parameters
- document OfficeIMO.Word.WordDocument
- Parent document.
- paragraph DocumentFormat.OpenXml.Wordprocessing.Paragraph
- Paragraph that contains the content control.
- stdRun DocumentFormat.OpenXml.Wordprocessing.SdtRun
- Underlying structured document run.
public WordStructuredDocumentTag(WordDocument document, SdtBlock sdtBlock) #Initializes a new instance from a structured document block.
Parameters
- document OfficeIMO.Word.WordDocument
- Parent document.
- sdtBlock DocumentFormat.OpenXml.Wordprocessing.SdtBlock
- Structured document block.
Methods
public WordStructuredDocumentTag SetBold(Boolean isBold = true) #WordStructuredDocumentTagSets the content control text to bold and returns the instance for chaining.
Parameters
- isBold System.Boolean = true
- Whether the text should be bold.
public WordStructuredDocumentTag SetColor(Nullable<Color> color) #WordStructuredDocumentTagSets the text color and returns the instance for chaining.
Parameters
- color System.Nullable{SixLabors.ImageSharp.Color}
- Text color, or null to clear.
public WordStructuredDocumentTag SetColorHex(String color) #WordStructuredDocumentTagSets the text color using a hexadecimal value and returns the instance for chaining.
Parameters
- color System.String
- Color in hexadecimal format.
public WordStructuredDocumentTag SetFontFamily(String fontFamily) #WordStructuredDocumentTagSets the font family and returns the instance for chaining.
Parameters
- fontFamily System.String
- Name of the font family.
public WordStructuredDocumentTag SetFontSize(Int32 fontSize) #WordStructuredDocumentTagSets the font size in points and returns the instance for chaining.
Parameters
- fontSize System.Int32
- Font size in points.
public WordStructuredDocumentTag SetHighlight(Nullable<HighlightColorValues> highlight) #WordStructuredDocumentTagSets the highlight color and returns the instance for chaining.
Parameters
- highlight System.Nullable{DocumentFormat.OpenXml.Wordprocessing.HighlightColorValues}
- Highlight color, or null to clear.
public WordStructuredDocumentTag SetItalic(Boolean isItalic = true) #WordStructuredDocumentTagSets the content control text to italic and returns the instance for chaining.
Parameters
- isItalic System.Boolean = true
- Whether the text should be italic.
public WordStructuredDocumentTag SetUnderline(Nullable<UnderlineValues> underline) #WordStructuredDocumentTagSets the underline style and returns the instance for chaining.
Parameters
- underline System.Nullable{DocumentFormat.OpenXml.Wordprocessing.UnderlineValues}
- Underline style, or null to clear.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.