Add a New Printer

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
 
S

Stuart McCall

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

Ivan Grozney

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
 
S

Stuart McCall

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?
 
I

Ivan Grozney

If you change the command to

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

Stuart McCall

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?
 
S

Stuart McCall

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

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