P
Pete
The following VBA macro, which I have used since 1999
without problems, suddenly no longer works. There have
been no changes to my system, network, or printers that
would change its operation. The macro saves the
identification of the currently specified printer, changes
the active printer, prints the document to that printer,
and then restores the original printer.
Sub Print_color()
' Macro recorded 11/9/99 by Pete
'
PrinterNow = ActivePrinter
ActivePrinter = "HP Color LaserJet 4500"
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True,
PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0
ActivePrinter = PrinterNow
End Sub
The macro hangs on the "ActivePrinter =" statement on this
and some similar macros I use. I suspect recent Microsoft
security upgrades may block changing the ActivePrinter.
The macro is quite consistent with Knowledge Base Article
162239.
Has anyone encountered similar problems and come up with a
fix?
without problems, suddenly no longer works. There have
been no changes to my system, network, or printers that
would change its operation. The macro saves the
identification of the currently specified printer, changes
the active printer, prints the document to that printer,
and then restores the original printer.
Sub Print_color()
' Macro recorded 11/9/99 by Pete
'
PrinterNow = ActivePrinter
ActivePrinter = "HP Color LaserJet 4500"
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True,
PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0
ActivePrinter = PrinterNow
End Sub
The macro hangs on the "ActivePrinter =" statement on this
and some similar macros I use. I suspect recent Microsoft
security upgrades may block changing the ActivePrinter.
The macro is quite consistent with Knowledge Base Article
162239.
Has anyone encountered similar problems and come up with a
fix?