# GetTextExtent Method

> Returns the width and height of the complete TXTextControl text in twips as an array of 2 Long values, independent of the zoom; the width is the longest line.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > GetTextExtent Method
- **160 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/gettextextent-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/gettextextent-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/gettextextent-method/llms-full.txt

---

Returns the extension of the complete text in [twips](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/#measure-in-twips). The text width is the largest line width of the currently contained text. Both values are in 100 percent independent of the zoom factor currently set. The text height is at least the height of the first line even if there is no text.

### Syntax

```vbscript
TXTextControl.GetTextExtent
```

### Return Value

The method returns an array of 2 long values specifying the width and the height of the text.

### Data Types

| Name | Data type |
|---|---|
| Return value | Array of 2 Long |

### See Also

- [Programming Category: Control Settings](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/control-settings/llms-full.txt)

---

## Nearby

- **Previous:** [GetLineRect Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinerect-method/llms-full.txt)
- **Next:** [GrowFont Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/growfont-method/llms-full.txt)
