TX Text Control ActiveX

Item Method

Method

Returns a specific Style object of a Styles collection.

Syntax

Styles.Item StyleName

Parameters

ParameterDescription
StyleNameSpecifies 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

NameData type
StyleNameString
Return valueStyle 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.

See Also