Printer Dialog Box

  • Thread starter Thread starter Bret
  • Start date Start date
B

Bret

I have VBA code I've written that Prints 10 reports I've created. I need in
code to first have the default Printer Dialog box appear to allow the users
to select the printer of their choice, once they print OK then ALL 10 reports
will print consecutively without the Printer Dialog box opening up for each
report. Also there is no need to PREVIEW the report before printing,
they'll again just print consecutively.

thanks for any assistance.
 
You have to build your own printer dialog box.

I would create a combo (or list) box with 1 column, set as "value list", and
then fill the combo with:

Dim ptr As Printer
Dim strPlist As String

For Each ptr In Printers
If strPlist <> "" Then
strPlist = strPlist & ";"
End If
strPlist = strPlist & ptr.DeviceName
Next ptr
Me.Combo0.RowSource = strPlist


The above will load up the combo box with a list of printers...

Now, for your print buttion,
Simply set the printer based on the choice in the above combo box

eg:

Set Application.Printer = Application.Printers(me.combo0)

-- code to print reports goes here.....
 
Back
Top