J
JbL
Hi,
I am working on a process in vba from excel that is creating both word
templates and xcl workbooks and printing them into pdf format. I haven't had
a problem sending any of the xcl stuff to the "Acrobat Distiller" as my
printer and getting those PDF files.
It's the Word part that is now giving me issues. I have a word template
called cover_lnd.dot that I fill with the appropriate info, but when I go to
print it to the distiller my code gives me a run-time error 5121.
The problem is that is only runs smoothly if I change the Flename:=PsFile to
Filename = "" where I get prompted for the path and file of the pdf doc. The
PsFile variable is a valid path and filename so why do I get the error and
how can I get around it??
'====================================
set mypdf = new pdfdistiller
psfile = savedir & sector & "_cvr.ps"
pdfile = savedir & sector & "_cvr.pdf"
cvrpage.application.activeprinter = "Acrobat Distiller"
CvrPage.Application.PrintOut Filename:=PSFile, _
Range:=wdPrintAllDocument, _
Item:=wdPrintDocumentContent, _
Copies:=1, _
Pages:="", _
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, _
Collate:=True, _
Background:=True, _
PrintToFile:=False, _
PrintZoomColumn:=0, _
PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
myPDF.FileToPDF PSFile, PDFile, ""
Kill PSFile
'======================================
Thank you for your assistance!
jbl
I am working on a process in vba from excel that is creating both word
templates and xcl workbooks and printing them into pdf format. I haven't had
a problem sending any of the xcl stuff to the "Acrobat Distiller" as my
printer and getting those PDF files.
It's the Word part that is now giving me issues. I have a word template
called cover_lnd.dot that I fill with the appropriate info, but when I go to
print it to the distiller my code gives me a run-time error 5121.
The problem is that is only runs smoothly if I change the Flename:=PsFile to
Filename = "" where I get prompted for the path and file of the pdf doc. The
PsFile variable is a valid path and filename so why do I get the error and
how can I get around it??
'====================================
set mypdf = new pdfdistiller
psfile = savedir & sector & "_cvr.ps"
pdfile = savedir & sector & "_cvr.pdf"
cvrpage.application.activeprinter = "Acrobat Distiller"
CvrPage.Application.PrintOut Filename:=PSFile, _
Range:=wdPrintAllDocument, _
Item:=wdPrintDocumentContent, _
Copies:=1, _
Pages:="", _
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, _
Collate:=True, _
Background:=True, _
PrintToFile:=False, _
PrintZoomColumn:=0, _
PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
myPDF.FileToPDF PSFile, PDFile, ""
Kill PSFile
'======================================
Thank you for your assistance!
jbl