Adobe distiller 7 does not work in MS Words 2003 macro

D

Daniel

I cannot get the distiller function to work in MS Word. If I have nothing in
the third argument field (strJobOptions) when calling FileToPDF, the macro
will hang. But I cannot find any references in Adobe Acrobat Distiller API
reference of what strJobOptions are required. When I tried to use "\N" or
"\q" option, the macro will run via the FileToPDF function without converting
the ps file to pdf. I have no problem in using a similar function in excel to
create PDF file using macro. My objective in this Word macro is to enable the
user to quickly print the current word file to PDF and then send the PDF file
to a FTP site. Now I am clueless of what to do next. Can anyone help ?
Following is my Word macro.

Dim myPDF As New ACRODISTXLib.PdfDistiller

Set fs = CreateObject("Scripting.FileSystemObject")
ActivePrinter = "Adobe PDF"
Application.PrintOut OutputFileName:="c:\temp\logbook.ps",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
True, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
myPDF.FileToPDF "c:\temp\logbook.ps", "c:\temp\logbook.pdf", ""
' fs.DeleteFile "c:\temp\logbook.ps"
 
D

Doug Robbins - Word MVP

See the article "Changing the selected (current) printer in Word without
changing the system default printer†at:

http://www.word.mvps.org/FAQs/MacrosVBA/ChangeCurPrinter.htm

Then having selected the Adobe PDF printer, use the PrintOut command to
print the document. Use the Printer Properties dialog for the Adobe PDF
printer to control whether or not you are prompted for the file name of the
output file. If you turn that option off, by default, the .pdf file will
have the same name as the document.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
D

Daniel

But how can I do it "silently" without popping up the adobe dialog box ? In
excel, I could do it by creating the ps file and calls the distiller to
convert to PDF. But this function does not seem to work in Words ?
 
D

Doug Robbins - Word MVP

I do not know about the Distiller, but with the Adobe PDF Printer, you can
via the Printer Properties dialog disable the prompt for filename and view
..pdf result facilities.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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