API Reference
WordTextBox
WordTextBox class
Inheritance
- WordElement
- WordTextBox
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method WordDocument.AddTextBox
- Method WordDocument.AddTextBoxVml
- Property WordDocument.TextBoxes
- Property WordFooter.TextBoxes
- Method WordHeader.AddTextBox
- Method WordHeader.AddTextBoxVml
- Property WordHeader.TextBoxes
- Property WordHeaderFooter.TextBoxes
- Method WordParagraph.AddTextBox
- Method WordParagraph.AddTextBoxVml
- Property WordParagraph.TextBox
- Method WordSection.AddTextBox
- Method WordSection.AddTextBoxVml
- Property WordSection.TextBoxes
Constructors
public WordTextBox(WordDocument wordDocument, String text, WordImageTextWrapping wrapTextImage) #Add a new text box to the document
Parameters
- wordDocument OfficeIMO.Word.WordDocument
- text System.String
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping
public WordTextBox(WordDocument wordDocument, WordParagraph paragraph, String text, WordImageTextWrapping wrapTextImage) #Create a text box from an existing paragraph
Parameters
- wordDocument OfficeIMO.Word.WordDocument
- paragraph OfficeIMO.Word.WordParagraph
- text System.String
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping
Methods
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public List<WordParagraph> Paragraphs { get; } #Gets a list of WordParagraph instances representing the paragraphs in the text box. Each WordParagraph is initialized with the WordDocument, the Paragraph, and the Run.
public List<WordElement> Elements { get; } #Gets the direct child elements contained in the text box in document order.
public Nullable<WordHorizontalRelativePosition> HorizontalPositionRelativeFrom { get; set; } #Gets or sets horizontal relative position of the text box
public Nullable<WordImageTextWrapping> WrapText { get; set; } #Gets or sets the wrap text of the text box
public WordTextBoxHorizontalAlignment HorizontalAlignment { get; set; } #Gets or sets the horizontal alignment of the text box
public WordVerticalRelativePosition VerticalPositionRelativeFrom { get; set; } #Gets or sets the relative4 vertical alignment of the text box
public Nullable<Int32> VerticalPositionOffset { get; set; } #Allows to set vertically position of the text box in twips (twentieths of a point)
public Nullable<Int32> HorizontalPositionOffset { get; set; } #Allows to set vertically position of the text box in twips (twentieths of a point) Please remember that this property will remove alignment of the text box and instead use Absolute position
public Nullable<Double> HorizontalPositionOffsetCentimeters { get; set; } #Allows to set horizontally position of the text box in centimeters
public Nullable<Double> VerticalPositionOffsetCentimeters { get; set; } #Allows to set vertically position of the text box in centimeters
public Nullable<Int32> RelativeWidthPercentage { get; set; } #Gets or sets the relative width percentage
public Nullable<Int32> RelativeHeightPercentage { get; set; } #Gets or sets the relative height percentage
public WordTextBoxAutoFitType AutoFit { get; set; } #Gets or sets the AutoFit behavior for the textbox.
public Boolean AutoFitToTextSize { get; set; } #Gets or sets whether the textbox resizes to fit text. Use AutoFit for more options.
public Nullable<WordTextBoxHorizontalSizeReference> SizeRelativeHorizontally { get; set; } #Sets size relative horizontally
public Double WidthCentimeters { get; set; } #Width of the text box in centimeters Sets the width of the text box in centimeters Sets the relative width percentage to 0 as it seems to be required
public Double HeightCentimeters { get; set; } #Height of the text box in centimeters Sets the height of the text box in centimeters Sets the relative height percentage to 0 as it seems to be required