API Reference

Class

WordTextBox

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

WordTextBox class

Inheritance

Usage

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 requiredposition: 0
text System.String requiredposition: 1
wrapTextImage OfficeIMO.Word.WordImageTextWrapping requiredposition: 2
public WordTextBox(WordDocument wordDocument, WordHeaderFooter wordHeaderFooter, String text, WordImageTextWrapping wrapTextImage) #

Create a text box in a header or footer

Parameters

wordDocument OfficeIMO.Word.WordDocument requiredposition: 0
wordHeaderFooter OfficeIMO.Word.WordHeaderFooter requiredposition: 1
text System.String requiredposition: 2
wrapTextImage OfficeIMO.Word.WordImageTextWrapping requiredposition: 3
public WordTextBox(WordDocument wordDocument, WordParagraph paragraph, String text, WordImageTextWrapping wrapTextImage) #

Create a text box from an existing paragraph

Parameters

wordDocument OfficeIMO.Word.WordDocument requiredposition: 0
paragraph OfficeIMO.Word.WordParagraph requiredposition: 1
text System.String requiredposition: 2
wrapTextImage OfficeIMO.Word.WordImageTextWrapping requiredposition: 3

Methods

public Void Remove() #
Returns: Void

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 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 Int64 Width { get; set; } #

Width of the text box

public Int64 Height { get; set; } #

Height of the text box

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