TextStyle Object
Publisher Developer Reference |
Represents a single built-in or user-defined style. The TextStyle object includes style attributes (font, font style, paragraph spacing, and so on) as properties of the TextStyle object. The TextStyle object is a member of the TextStyles collection. The TextStyles collection includes all the styles in the specified document.
Example
Use TextStyles(index), where index is the text style number or name, to return a single TextStyle object. You must exactly match the spelling and spacing of the style name, but not necessarily its capitalization.
The following example displays the style name and base style of the first style in the TextStyles collection.
Visual Basic for Applications |
---|
|
Use the Add method to create a new style. To apply a style to a range, paragraph, or multiple paragraphs, set the TextStyle property to a user-defined or built-in style name. The following example creates a new style and applies it to the paragraph at the cursor position.
Visual Basic for Applications |
---|
|
See Also