Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: Conversion Word -> PDF with Adobe Acrobat and VBA
Conf: (P-PDF) Developers, Msg: 126383
From: Uta
Date: 1/27/2005 04:13 AM


I'm trying to do the following in a VBA Word macro:
1. Open several Word-files from a drive, and change them. The changed files are not saved on the drive but only kept in working storage.
2. The changed files are now to be converted to PDF and saved under a predefined path and filename using Adobe Acrobat.

These are my problems:

1. Acrobat makes a .ps file and saves it correctly on the drive. Before making the .pdf, however, it shows the "save file as"-dialogue. After pressing Abort, the .pdf file is created correctly, but saved on the desktop instead of the path I want it to be saved. How can I prevent the "save as" dialogue from showing up and give the correct path to Acrobat?
My users work with Windows 2000, and they don't have local admin rights on their machines, so I can't work with the registry. Sadly, the file Pdfwritr.ini doesn't seem to be available any more with Win2k.

2. Acrobat PFDWriter does not use the changed file in the working storage for conversion but draws the original file from the drive. Is there a way to prevent this?

3. Is it possible to open the new PDF file in Acrobat Reader or print it, using VBA?

I'll be thankful for any hint concerning any one of the above questions!

BTW I'm working with Acrobat and Distiller 5.0.

This is my code:

Public Function Doc2PDF(application As Object, wasserzeichen As
String, WordDocument As String, PDFDocument As String) As Boolean

Dim psFile As String
Dim DefaultPrinter As String

On Error GoTo errhand

'PDFDocument contains the path and filename for the pdf
psFile = PDFDocument & ".ps"

With application
DefaultPrinter = application.ActivePrinter
.ActivePrinter = "Acrobat PDFWriter"
.PrintOut 0, 0, 0, psFile, , , , , , , True
'switch off "Print to file"
.PrintOut , , 4, , , , , , "0", , False
.ActivePrinter = DefaultPrinter
End With

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.