Printer Dialog Box

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.
 
A

Albert D. Kallal

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.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top