# HeaderFooterCollection Class

> An instance of the HeaderFooterCollection class contains the headers and footers in a Text Control document represented through objects of the type HeaderFooter. An instance of this class can be either obtained through the TextControl.HeadersAndFooters or through the Section.HeadersAndFooters property. The first collection represents headers and footers common to all sections of the document and the second collection represents the headers and footers of a certain section. The HeaderFooterCollection class implements the IEnumerable and the ICollection interface.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > HeaderFooterCollection Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/#members)

---

## In This Section

- [HeaderFooterCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/add-method/llms.txt): Adds a new header or footer to a Text Control document or to a certain section of the document. If a header or footer is added to the complete document the first section receives the header or footer and all other sections receive headers or footers which are connected to their previous section. To add more than one header or footer a combination of the HeaderFooterType enumeration values can be used.
- [HeaderFooterCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/copyto-method/llms.txt): Copies the elements of the collection to an array, starting at a particular index.
- [HeaderFooterCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/count-property/llms.txt): Gets the number of elements contained in the collection.
- [HeaderFooterCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/getenumerator-method/llms.txt): Returns an enumerator that can be used to iterate through the collection.
- [HeaderFooterCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/getitem-method/llms.txt): 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.
- [HeaderFooterCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/remove-method/llms.txt): Removes a header or footer from a Text Control document or from a certain section. To remove more than one header or footer a combination of the HeaderFooterType enumeration can be used.

---

## Nearby

- **Previous:** [HeaderFooter.Type Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/type-property/llms.txt)
- **Next:** [HeaderFooterCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/add-method/llms.txt)
