printing from a macro issues

C

chefk

Hello,

My problem is this. When I try to print a mail merge document to a
redirected printer from a Word 2003 document in a 2003 Terminal Server
session via a macro, the document does not print. If I print manually
via the Word menu, it does print. I honestly do not expect an answer as
I think this is a MS issue (they have had a few with redirected
printing), but what I am hoping for is possibly another method of
printing that may work. What can I use besides .PRINTOUT? I am not a
Word expert, so be gentle. Thanks in advance.

Mike

here is my code:

Public Sub SwitchPrinterAndPrint(printer As String)
Dim strActivePrinter As String
' Get active printer.
strActivePrinter = Application.ActivePrinter
' Change to the passed printer
Application.ActivePrinter = printer
' Print the active document to selected printer
ActiveDocument.PrintOut
' Change back to the default printer.
Application.ActivePrinter = strActivePrinter
End Sub
 
M

Mikael Sorensen

Be sure to name your printer correct.

How to test:
Set the printer, that you want to use, default on the PC.
Run this macro from Word:
Sub test()
MsgBox Application.ActivePrinter
End Sub

Use the output as input in SwitchPrinterAndPrint.
The portname (" on NExx:") can be found in windows registry.
Hope this helps.

Regards,
Mikael
 

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