The PrintRange property is used by the PrintDialog.when the user selects a print range. The default PrintRange is AllPages. To allow the user to specify a range of pages to print, the PrintDialog.AllowSomePages property must be set to true. To allow the user to specify the selected pages to print, the PrintDialog.AllowSelection property must be set to true.
During the printing process, in the PrintDocument.PrintPage event, check the PrintRange to see what should be printed. If PrintRange is PrintRange.SomePages, use the FromPage and ToPage properties to determine what pages should be printed. If PrintRange is PrintRange.Selection, then specify output only for the selected pages.
The FromPage, ToPage and PrintRange can also be set programmatically, though the PrintDocument.PrintPage implementation is the same.