# HeaderFooterCollection.GetItem Method

> Gets a particular header or footer from the collection. If the specified header or footer does not exist in the collection an ArgumentException is thrown.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > HeaderFooterCollection.GetItem Method
- **715 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/getitem-method/llms-full.txt

---

### Description

Gets a particular header or footer from the collection. If the specified header or footer does not exist in the collection an ArgumentException is thrown.

### Syntax

```csharp
public HeaderFooter GetItem(HeaderFooterType headerFooterType);
```

```vbnet
Public Function GetItem(headerFooterType As HeaderFooterType) As HeaderFooter
```

### Parameters

| Parameter | Description |
|---|---|
| headerFooterType | Specifies the header or footer to return. It can be a value of the [HeaderFooterType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootertype/enumeration/llms-full.txt) enumeration:  \| Value \| Meaning \| \| Header \| Returns the header. If an even header exists, the returned object represents the odd header. Otherwise, it represents the header of all pages. \| \| FirstPageHeader \| Returns the special header of the document's first page. \| \| Footer \| Returns the footer. If an even footer exists, the returned object represents the odd footer. Otherwise, it represents the footer of all pages. \| \| FirstPageFooter \| Returns the special footer of the document's first page. \| \| EvenHeader \| Returns the even header. \| \| EvenFooter \| Returns the even footer. \| |
|---|

### Examples

The following example retrieves the section footer and updates its text.

```csharp
HeaderFooterCollection headersAndFooters = textControl.Sections[1].HeadersAndFooters;
headersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = headersAndFooters.GetItem(HeaderFooterType.Footer);
footer.Selection.Text = "Confidential — Finance Department";
```

```vbnet
Dim headersAndFooters As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headersAndFooters.Add(HeaderFooterType.Footer)
Dim footer As HeaderFooter = headersAndFooters.GetItem(HeaderFooterType.Footer)
footer.Selection.Text = "Confidential — Finance Department"
```

---

## Nearby

- **Previous:** [HeaderFooterCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/getenumerator-method/llms-full.txt)
- **Next:** [HeaderFooterCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/remove-method/llms-full.txt)
