# DocumentLinkCollection.GetItem Method

> Gets a particular document link from the collection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > DocumentLinkCollection.GetItem Method
- **896 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documentlinkcollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documentlinkcollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documentlinkcollection/getitem-method/llms-full.txt

---

### Description

Gets a particular document link from the collection.

### Syntax

#### GetItem()

Gets the document link at the current input position or null if there is no document link at the current input position.

```csharp
public DocumentLink GetItem();
```

```vbnet
Public Function GetItem() As DocumentLink
```

#### GetItem(int)

Gets the document link with the specified id, previously set with the [DocumentLink.ID](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfield/id-property/llms-full.txt) property.

```csharp
public DocumentLink GetItem(int id);
```

```vbnet
Public Function GetItem(id As Integer) As DocumentLink
```

| Parameter | Description |
|---|---|
| id | Specifies the document link's identifier. The method returns null if a document link with the specified identifier does not exist. |

### Examples

The following example works with document links in the current document by using `DocumentLinkCollection.get_Item`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentLinkCollection documentLinkCollection = textControl.DocumentLinks;
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
documentLinkCollection.Add(new DocumentLink("View customer details", target) { ID = 100 });

DocumentLink result = documentLinkCollection.GetItem(100);
result?.ScrollTo();
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentLinkCollection As DocumentLinkCollection = textControl.DocumentLinks
Dim target As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(target)
documentLinkCollection.Add(New DocumentLink("View customer details", target) With { .ID = 100 })

Dim result As DocumentLink = documentLinkCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()
```

---

## Nearby

- **Previous:** [DocumentLinkCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documentlinkcollection/copyto-method/llms-full.txt)
- **Next:** [DocumentLinkCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documentlinkcollection/item-property/llms-full.txt)
