Item Method
Syntax
Styles.Item StyleName
Parameters
| Parameter | Description |
|---|---|
| StyleName | Specifies the name of the style. If this value does not match any existing member of the collection, an error occurs. |
Return Value
The method returns a Style object.
Data Types
| Name | Data type |
|---|---|
| StyleName | String |
| Return value | Style Object |
Examples
The first of the following Basic examples displays the name of the font used with the Headline formatting style. The second enumerates the names of all styles and its fonts in a document. In the third example, it is shown how to change a style property programmatically:
MsgBox TXTextControl1.Styles.Item("Headline").FontName
For Each style In TXTextControl1.Styles
Debug.Print "Style name: " + style + ", Font name: " + style.FontName
Next
Set Style = TXTextControl1.Styles.Item(TXTextControl1.StyleCurrent)
Style.FontName = "Arial"
Style.FontSize = 400
Style.Apply
Limitations
Run time only.