D
David
Since my knowledge of VBA is limited, I have recorded the
following macro to print my document as a .prn file in a
certain location using a certian printer driver, then
return the active printer to the default printer:
ActivePrinter = "APS-PS PIP with APS-6-108 v49.3 or 52.2"
Application.PrintOut FileName:="",
range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True,
PrintToFile:=True, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0, _
OutputFileName:="C:\My PDFs", Append:=False
ActivePrinter = "\\TCG_SERVER\CNC_4050"
With Dialogs(wdDialogFilePrint)
.PrintToFile = False
.Execute
End With
I want to change the 'OutputFileName:="C:\My PDFs",' so
that it takes the name of the original document and names
it 'OriginalDocumentName.prn'. How is that coded?
I also included the last 4 lines of code to uncheck
the 'Print to file' check box the next time the Print
dialog is accessed, however it unchecks the box but also
prints the document, which I don't want. I tried .Update,
but that didn't work. Any suggestions?
TIA
David
following macro to print my document as a .prn file in a
certain location using a certian printer driver, then
return the active printer to the default printer:
ActivePrinter = "APS-PS PIP with APS-6-108 v49.3 or 52.2"
Application.PrintOut FileName:="",
range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True,
PrintToFile:=True, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0, _
OutputFileName:="C:\My PDFs", Append:=False
ActivePrinter = "\\TCG_SERVER\CNC_4050"
With Dialogs(wdDialogFilePrint)
.PrintToFile = False
.Execute
End With
I want to change the 'OutputFileName:="C:\My PDFs",' so
that it takes the name of the original document and names
it 'OriginalDocumentName.prn'. How is that coded?
I also included the last 4 lines of code to uncheck
the 'Print to file' check box the next time the Print
dialog is accessed, however it unchecks the box but also
prints the document, which I don't want. I tried .Update,
but that didn't work. Any suggestions?
TIA
David