# Item Method

> Returns the Style object with the given style name from a Styles collection, with Basic examples that read a font, enumerate all styles and change a style.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > Styles > Item Method
- **408 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/styles/item-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/styles/item-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/styles/item-method/llms-full.txt

---

Returns a specific [Style](https://docs.textcontrol.com/tx-text-control-activex/reference/style/llms-full.txt) object of a [Styles](https://docs.textcontrol.com/tx-text-control-activex/reference/styles/llms-full.txt) collection.

### Syntax

```vbscript
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](https://docs.textcontrol.com/tx-text-control-activex/reference/style/llms-full.txt) object.

### Data Types

| Name | Data type |
|---|---|
| StyleName | String |
| Return value | [Style Object](https://docs.textcontrol.com/tx-text-control-activex/reference/style/llms-full.txt) |

### 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:

```vbscript
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

- [Style Object](https://docs.textcontrol.com/tx-text-control-activex/reference/style/llms-full.txt)
- [Programming Category: Stylesheet Programming](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/stylesheet-programming/llms-full.txt)

---

## Nearby

- **Previous:** [Count Property](https://docs.textcontrol.com/tx-text-control-activex/reference/styles/count-property/llms-full.txt)
- **Next:** [XMLElement Object](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt)
