Using macro to display and change printer

L

luch

I have a macro that displays a form to print a Gantt chart - I would
like this form to also show the currently selected printer and a button
to change, the printer, if desired. I have this functionality in Excel
VBA, like so:

'button to change printer
Sub PrinterChg_Click()
Application.Dialogs(xlDialogPrinterSetup).Show
PrinterLabel.Caption = Application.ActivePrinter
End Sub

Unfortunately, while apparently I can change the printer with
FilePrintSetup in Project, I can't see a way to return the current
printer, like "Application.ActivePrinter", nor can I find a way to
display a printer selection box, like "xlDialogPrinterSetup" provides.


Are there built-in functions in Project that offer the same info as in
Excel? Or is there a way to do what I want through VBA?

thanks for any help.
Shaun
 
R

Rod Gill

I searched the Object Browser and there wasn't anything to be found there
for reading the current printer. I suspect therefore that this can't be
done.
 
B

Bill Bordiuk

You can make API calls from VBA, I believe. You might want to look into
using Windows API calls for the printer common dialog box. Lots of folks
have written free VB code to deal with the common dialogs. Google up "common
dialog printer vb" or the like and see if that suits your needs.

Bill B
 

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