Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordTextBox

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

WordTextBox class

Inheritance

Usage

Explore 14 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

WordTextBox 3 overloads
public WordTextBox(WordDocument wordDocument, string text, WordImageTextWrapping wrapTextImage) #

Add a new text box to the document

Parameters

wordDocument OfficeIMO.Word.WordDocument required
text string required
wrapTextImage OfficeIMO.Word.WordImageTextWrapping required
public WordTextBox(WordDocument wordDocument, WordHeaderFooter wordHeaderFooter, string text, WordImageTextWrapping wrapTextImage) #

Create a text box in a header or footer

Parameters

wordDocument OfficeIMO.Word.WordDocument required
wordHeaderFooter OfficeIMO.Word.WordHeaderFooter required
text string required
wrapTextImage OfficeIMO.Word.WordImageTextWrapping required
public WordTextBox(WordDocument wordDocument, WordParagraph paragraph, string text, WordImageTextWrapping wrapTextImage) #

Create a text box from an existing paragraph

Parameters

wordDocument OfficeIMO.Word.WordDocument required
paragraph OfficeIMO.Word.WordParagraph required
text string required
wrapTextImage OfficeIMO.Word.WordImageTextWrapping required

Methods

public void Remove() #

Removes the text box from the document along with the paragraph

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 string? Description { get; set; } #

Gets or sets the accessibility description for the text box.

public WordHorizontalRelativePosition? HorizontalPositionRelativeFrom { get; set; } #

Gets or sets horizontal relative position of the text box

public 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 OfficeLength? VerticalPositionOffset { get; set; } #

Gets or sets the explicit vertical anchor offset as a physical length. Setting an offset replaces vertical alignment. Null preserves the existing offset.

public OfficeLength? HorizontalPositionOffset { get; set; } #

Gets or sets the explicit horizontal anchor offset as a physical length. Setting an offset replaces horizontal alignment. Null preserves the existing offset.

public int? RelativeWidthPercentage { get; set; } #

Gets or sets the relative width percentage

public int? 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 bool AutoFitToTextSize { get; set; } #

Gets or sets whether the textbox resizes to fit text. Use WordTextBox.AutoFit for more options.

public WordTextBoxHorizontalSizeReference? SizeRelativeHorizontally { get; set; } #

Sets size relative horizontally

public OfficeLength Width { get; set; } #

Gets or sets the physical frame width of an anchored or inline text box. Relative sizing remains controlled by RelativeWidthPercentage.

public OfficeLength Height { get; set; } #

Gets or sets the physical frame height of an anchored or inline text box. Relative sizing remains controlled by RelativeHeightPercentage.

public OfficeColor? FillColor { get; set; } #

Gets or sets the DrawingML text-box solid RGB fill color; null removes the solid fill.

public uint ZOrder { get; set; } #

Gets or sets the native DrawingML anchor stacking order.