Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

Printer Toolbar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sondra - 22 Aug 2006 21:28 GMT
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.
garfield-n-odie [MVP] - 22 Aug 2006 21:48 GMT
YOUR code?  This "Macro created 8/22/2006 by SB" is blatantly
plagiarized from http://www.gmayor.com/fax_from_word.htm , so
it's no surprise that you haven't got a clue as to how it works
or how to modify it.

> 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:
[quoted text clipped - 25 lines]
>
> Any advise, help or answers would be greatly appreciated.
Sondra - 22 Aug 2006 22:32 GMT
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.

> YOUR code?  This "Macro created 8/22/2006 by SB" is blatantly
> plagiarized from http://www.gmayor.com/fax_from_word.htm , so
[quoted text clipped - 30 lines]
> >
> > Any advise, help or answers would be greatly appreciated.
Jean-Yves - 23 Aug 2006 09:33 GMT
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

> Yes, you are write, I did get it from that file.  But I thought that is
> what
[quoted text clipped - 47 lines]
>> >
>> > Any advise, help or answers would be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.