Hi
Within MS Word, I've set up a macro to print to a specific printer using .FilePrintSetup , then print 2 copies out using different trays.
Is there a way to set word BACK to the DEFAULT printer at the end of the macro, so that if the user prints any other documents, they print to the default printer (without having to manually change in "File>Print...")?
The code so far is:
This code does not change the default printer, but word retains the last printer used as the one to print to next.
Thanks
Kev
Within MS Word, I've set up a macro to print to a specific printer using .FilePrintSetup , then print 2 copies out using different trays.
Is there a way to set word BACK to the DEFAULT printer at the end of the macro, so that if the user prints any other documents, they print to the default printer (without having to manually change in "File>Print...")?
The code so far is:
Code:
Sub printLHPL()
'
' printLHPL Macro
' Macro recorded 11/04/2005 by Nabeel
'
Application.WordBasic.FilePrintSetup Printer:="\\servername\printername on prinerport", _
DoNotSetAsSysDefault:=1
With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterPaperCassette
End With
ActiveDocument.PrintOut
With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterPaperCassette
.OtherPagesTray = wdPrinterPaperCassette
End With
ActiveDocument.PrintOut
End Sub
This code does not change the default printer, but word retains the last printer used as the one to print to next.
Thanks
Kev