Private Sub Command1_Click()
Dim beginpage, endpage, numcopies, orientation, i
CommonDialog1.CancelError = True
On Error GoTo errhandler
CommonDialog1.ShowPrinter
beginpage = CommonDialog1.FromPage
endpage = CommonDialog1.ToPage
numcopies = CommonDialog1.Copies
orientation = CommonDialog1.orientation
For i = 1 To numcopies
Next
Exit Sub
errhandler:
Exit Sub
end sub