Printer Toolbar

S

Sondra

I am trying to create a set of buttons for my printers; however, I am having
a problem with the naming of the printer. Here is my code:

Sub MyPrint()
'
' Printer004 Macro
' Macro created 8/22/2006 by SB
'
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
ActivePrinter = "LZN0004"
Application.PrintOut FileName:=""
ActiverPrinter = sCurrentPrinter
End Sub

When I run the Macro, I get this message:

Run time error '5216'

There is a printer error

When I choose debug it always highlights this line

ActivePrinter = "LZN0004"


I have modified this line several time and just don't know what I'm doing
wrong...

Any advise, help or answers would be greatly appreciated.
 
S

Sondra

Yes, you are write, I did get it from that file. But I thought that is what
the files were out there for. I'm sorry if I stated my code. I was just
stating that it was how I entered it into my database. No need to make me
feel like I'm stealing something from someone else. I realize that Graham
wrote it and yes I give him full credit. I'm a newbie to Word code and again
apologize if I offended you or anyone else. I always believed that the
reason the code was out there was to help people, not for looks only. Again,
Graham I apologize that I didn't exactly state that I reviewed the files and
copied code. Garfield-n-odie, I'm only looking for help, not a death
sentence.
 
J

Jean-Yves

Hi Sondra,
Select the printer you need, the in the immediate window
type ? Application.ActivePrinter.
It should read something like :
HP DeskJet 1120C on LPT1:
\\MASNL07\MQ018_PS on NE02:
Use that given string instead of "LZN0004"
Regards

Jean-Yves
 

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