-
Macro to print to a specific printer (Word)
Wasnt sure where to post this though this was the most accurate Forum.
I have this code and I get a Run Time 5216 Error - There is a printer error.
This is my code and it stops on the *ActivePrinter = "Zebra"*
[VBA]
Sub FaxPrint()
Dim sCurrentPrinter As String
On Cancel GoTo Cancelled:
sCurrentPrinter = ActivePrinter
ActivePrinter = "Zebra"
Application.PrintOut FileName:="label.dot"
Cancelled:
ActivePrinter = sCurrentPrinter
End Sub
[/VBA]
Any help is greatly appreciated before I go mad
Edited 7-Sep-07 by geekgirlau. Reason: insert vba tags
-
[vba]
Sub FaxPrint()
Dim sCurrentPrinter As String
On Cancel GoTo Cancelled:
sCurrentPrinter = ActivePrinter
ActivePrinter = PUT COMPLETE NETWORK PATH HERE ex: \\xxx\XEROX
Application.PrintOut FileName:="label.dot"
Cancelled:
ActivePrinter = sCurrentPrinter
End Sub
[/vba]
Edited 7-Sep-07 by geekgirlau. Reason: insert vba tags
-
Hi guys (and Double, welcome to the Board!)
When you post code, please use the vba tags (select your code text and click on the "VBA" button) - I've edited your posts so you can see what this looks like.
Nice to see new converts posting answers vksingh24!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules