# TargetNext Method

> Returns the identifier of the link target that follows a given target, or of the first target when zero is passed, to enumerate all targets.

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

---

This method returns the identifier of the link target that follows the specified target in the Text Control's current text. It can be used to find the next target in the text or to enumerate all targets.

Introduced: 28.0.

### Syntax

```vbscript
TXTextControl.TargetNext TargetId
```

### Parameters

| Parameter | Description |
|---|---|
| TargetId | Specifies the target's unique identifier. This must be the value returned from the [TargetInsert](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/targetinsert-method/llms-full.txt) method. If this parameter is zero, the identifier of the first target is returned. |

### Return Value

The method returns the identifier of the target that follows the specified target. It returns zero when there is no following target.

### Data Types

| Name | Data type |
|---|---|
| TargetId | Long |
| Return value | Long |

### See Also

- [Marked Text Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/fields/llms-full.txt)
- [Programming Category: Hypertext Links](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/hypertext-links/llms-full.txt)

---

## Nearby

- **Previous:** [TargetName Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/targetname-property/llms-full.txt)
- **Next:** [TargetPos Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/targetpos-property/llms-full.txt)
