# TextControl.GetPages Property

> Gets a collection of all pages in the document. The property's value is an object of the type PageCollection. This collection is only available, if the property has been set to ViewMode.PageView. Otherwise, the method returns null.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.GetPages Property
- **342 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getpages-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getpages-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getpages-property/llms-full.txt

---

### Description

Gets a collection of all pages in the document. The property's value is an object of the type [PageCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagecollection/llms-full.txt). This collection is only available, if the [](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/viewmode-property/llms-full.txt) property has been set to `ViewMode.PageView`. Otherwise, the method returns null.

### Syntax

```csharp
public PageCollection GetPages();
```

```vbnet
Public Function GetPages() As PageCollection
```

### Examples

The following example includes the pages value in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Pages: {textControl.Pages}");
Console.WriteLine("Text Control is ready for use.");
```

```vbnet
Console.WriteLine($"Pages: {textControl.Pages}")
Console.WriteLine("Text Control is ready for use.")
```

---

## Nearby

- **Previous:** [TextControl.GetClipboardFormats Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getclipboardformats-method/llms-full.txt)
- **Next:** [TextControl.GetSupportedFonts Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getsupportedfonts-method/llms-full.txt)
