textAlign Property
Returns and sets a String that represents how text is aligned in an element. Corresponds to the text-align property for a cascading style sheet.
expression.textAlign
*expression * Required. An expression that returns one of the objects in the Applies To list.
Remarks
The String value for the textAlign property can be one of the following:
Value | Description |
---|---|
left |
Text is aligned to the left. Default. |
right |
Text is aligned to the right. |
center |
Text is centered. |
justify |
Text is justified. |
Example
The following example sets the text in the body to align on the right side of the page.
ActiveDocument.body.style.textAlign = "right"
The following example centers text in the first paragraph in the active document.
ActiveDocument.all.tags("p").Item(0).Style.textAlign = "center"
Applies to | FPHTMLStyle Object | IFPStyleState Object | IHTMLRuleStyle Object | IHTMLStyle Object