Add a New Printer

  • Thread starter Thread starter Ivan Grozney
  • Start date Start date
I

Ivan Grozney

I have used things from these posts to bring up the default Printer Dialog
box so that a user can choose a printer for the report. I also have built my
own.

However, occasionally (more than I care to admit) I have users without a
printer installed but the PDF or the MS XPS DOCUMENT WRITER and the MS OFFICE
DOCUMENT IMAGE WRITER.

On the standard dialog box there is no FIND PRINTER like other Office
products. So I built my own figuring I could add the Add Printer like what
is in "Add a printer" under printers and faxes. So I get to the ADD
PRINTER.PDS file that brings up the part where you add a printer.

However, when I try to call it from within Access as a shell, I get

Invalid procedure call or argument.

Does anyone know how to call Add A Printer from within Access VBA?

tia

Vanya
 
Ivan Grozney said:
I have used things from these posts to bring up the default Printer Dialog
box so that a user can choose a printer for the report. I also have built
my
own.

However, occasionally (more than I care to admit) I have users without a
printer installed but the PDF or the MS XPS DOCUMENT WRITER and the MS
OFFICE
DOCUMENT IMAGE WRITER.

On the standard dialog box there is no FIND PRINTER like other Office
products. So I built my own figuring I could add the Add Printer like
what
is in "Add a printer" under printers and faxes. So I get to the ADD
PRINTER.PDS file that brings up the part where you add a printer.

However, when I try to call it from within Access as a shell, I get

Invalid procedure call or argument.

Does anyone know how to call Add A Printer from within Access VBA?

tia

Vanya

Shell "rundll32.exe printui.dll, PrintUIEntry /il"

will bring up the Add Printer Wizard.
 
Stuart,

Thank you, works great! Two more questions...

1. When I bring this up, it opens up behind the access window, any ideas on
how to bring it up in front?

2. Do you know how to bring up the FIND PRINTER dialog box?

Thanks,

Vanya
 
Ivan Grozney said:
Stuart,

Thank you, works great! Two more questions...

1. When I bring this up, it opens up behind the access window, any ideas
on
how to bring it up in front?

2. Do you know how to bring up the FIND PRINTER dialog box?

Thanks,

Vanya
<SNIP>

I'm afraid it's no to both questions. Perhaps someone else can jump in?
 
If you change the command to

Shell "rundll32.exe printui.dll, PrintUIEntry /il", vbNormalFocus
it will set focus to the add printer wizard.
 
Ivan Grozney said:
If you change the command to

Shell "rundll32.exe printui.dll, PrintUIEntry /il", vbNormalFocus
it will set focus to the add printer wizard.

Already tested that. Doesn't do it for me...

Win XP Pro SP2 here. How about you?
 
Ivan Grozney said:
Stuart,

I have XP Pro with SP3. Running Access 2003.

Well in that case the only difference between us is SP3. Perhaps someone
else with SP2 could try it and confirm/deny my result in this thread...
 
Back
Top