PAQ'd and points refunded
modulo
Community Support Moderator
Experts Exchange
Main Topics
Browse All TopicsI'm using Adobe Acrobat 5 and Word 2002 and am writing some macros to output a document as a .pdf file. Web wisdom says I first need to convert the file to a PostScript one and then covert this to a pdf using Distiller.
Here's what I've got so far:
1. A reference to the Acrobat library at Project level
2. A class module ("Class1") as follows:
Public WithEvents oDIst As PDFDistiller
Private Sub Class_Initialize()
Set oDIst = New PDFDistiller
End Sub
3. A macro in a regular module as follows:
Sub SaveAsWMA()
Dim myPDFDist As Class1
oldPrinter = ActivePrinter
psFilename = "c:\watermarker output\wma\"& myname & ".ps"
pdfFilename = "c:\watermarker output\wma\"& myname" & ".pdf"
Application.ActivePrinter = "Acrobat Distiller"
ActiveDocument.PrintOut Background:=False, printtofile:=True, outputfilename:=psFilename
Set myPDFDist = New Class1
Call myPDFDist.oDIst.FileToPDF(
Application.ActivePrinter = oldPrinter
End Sub
This seems consistent with a few examples I've seen on the web. The problem is, this hangs Word when I run it. I get an hourglass and Word's title bar reports 'not responding'. This has happened on 2 different machines.
It looks like it actually hangs on the conversion to PostScript, because a .ps file is never created.
Where have I gone wrong?
Ray
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: RayBlakePosted on 2003-01-01 at 02:54:31ID: 7651772
I've actually progressed this a little further. The string handling was sending things wobbly, so I've simplified if below.
arker output\wma\dummy.ps"
"c:\waterm arker output\wma\dummy.ps", "", "")
Sub SaveAsWMA()
Dim myPDFDist As Class1
'myname = ActiveDocument.Name
'psFilename = "c:\watermarker output\wma\" & myname & ".ps"
'pdfFilename = "c:\watermarker output\wma\" & myname & ".pdf"
ActiveDocument.PrintOut Background:=False, printtofile:=True, outputfilename:="c:\waterm
Set myPDFDist = New Class1
Call myPDFDist.oDIst.FileToPDF(
End Sub
Now, I create the .ps OK, but get a run time error with the narrative:
method 'FileToPDF' of object 'IPdfDistiller' failed
Help.
Ray