[Overview][Types][Classes][Variables][Index] | Reference for unit 'Printers' (#lcl)

# TPrinter.SelectCurrentPrinterOrDefault

Selects the default printer when a printer has not been selected.

## Declaration

Source position: printers.pas line 263

`protected procedure TPrinter.SelectCurrentPrinterOrDefault;`

## Description

SelectCurrentPrinterOrDefault ensures that a valid print device is selected. The default printer (the first device in Printers) is used when PrinterIndex has not been assigned and the number of devices in Printers is not 0 (zero).

SelectCurrentPrinterOrDefault is called from the implementation of the BeginDoc method, and when the list in Printers is loaded in the GetPrinters method. It is also called when the paper size for a print device is validated in the TPaperSize.CheckSupportedPapers method.