Hi!
There are codes for printer setup by using Common Dialog control. You may create Common Dialog control object on your form before running this codes. (MSCOMCTL.OCX)
Private Sub pbPrinter_Click()
On Error GoTo Err_pbPrinter_Click
Dim objDialog As Object
Dim BeginPage, EndPage, NumCopies, i
Set objDialog = Me.cmnDialog.Object
With objDialog
.CancelError = True
.DialogTitle = "Printer Setup Sample"
.flags = 0 ' &H8 Or &H4 Or &H80000 Or &H0
.ShowPrinter
' Get user-selected values from the dialog box
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
For i = 1 To NumCopies
' Put code here to send data to the printer
Next i
End With
Exit_pbPrinter_Click:
Exit Sub
Err_pbPrinter_Click:
If Err.Number <> 32755 Then 'Cancel action
'MsgBox "Error No " & Err.Number & vbLf & Error$
End If
Resume Exit_pbPrinter_Click
End Sub
Aivars