# PrintPage Method

> Prints one page, numbered from 1, on the printer set through PrintDevice; the Basic example prints all pages with Printer.hDC, CurrentPages and NewPage.

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

---

Prints a page of text on the default printer. The number is specified through PageNumber.

### Syntax

```vbscript
TXTextControl.PrintPage PageNumber
```

### Parameters

| Parameter | Description |
|---|---|
| PageNumber | Specifies the number of the page to print. The first page has the number 1. |

### Return Value

This method has no return value.

### Data Types

| Name | Data type |
|---|---|
| PageNumber | Integer |

### Examples

This Basic example shows how to print the contents of a Text Control on the default printer:

```vbscript
Sub mnuFile_Print_Click ()
   Dim wPages, No
   Printer.Print
   wPages = TXTextControl1.CurrentPages
   For No = 1 To wPages
      TXTextControl1.PrintDevice = Printer.hDC
      TXTextControl1.PrintPage No
      Printer.NewPage
   Next No
   Printer.EndDoc
End Sub
```

### Remarks

Prior to using this method the Text Control's output device must be selected using the [PrintDevice](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/printdevice-property/llms-full.txt) property.

### See Also

- [PageHeight Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/pageheight-property/llms-full.txt)
- [PageMarginx Properties](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/pagemarginb-property/llms-full.txt)
- [PageWidth Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/pagewidth-property/llms-full.txt)
- [PrintDevice Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/printdevice-property/llms-full.txt)
- [Programming Category: Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/printing/llms-full.txt)

---

## Nearby

- **Previous:** [PrintOffset Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/printoffset-property/llms-full.txt)
- **Next:** [PrintZoom Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/printzoom-property/llms-full.txt)
