convert word document to pdf programmatically in

convert word document to pdf programmatically in

Post by TWFya » Fri, 03 Jun 2005 15:33:02

Hi, I want to convert mailmerged documents to pdf's in I have Acrobat
5 installed, but do not know how to make it all work. what do I need to do?
Are there any code samples available? I've seen lots of replies to questions
similar to this that merely state that the distiller is needed....that isn't
of any help....if anyone has info a little deeper than that, it would be most
appreciated. Thanks!

convert word document to pdf programmatically in

Post by v-phuan » Fri, 03 Jun 2005 16:55:23


Since the PDF format is developped by Adobe. So Word has no idea how to
convert word doc format to pdf format.
The distiller or PDF Writer is similar with a printer. Word just print the
word document to the special printer, and the PDF Writer or distiller has
the responsibility to convert the printer recognized data into PDF format.
For Word side, it just know that it has printed a word document to the
Then the PDF Writer or Distiller which is installed by Adobe Acrobat will
get the printer recognize data into PDF file.

For Word, we have object modal to print a word document to a printer via
Imports Word = Microsoft.Office.Interop.Word
Module Module1
Sub Main()
Dim wdApp As New Word.Application
Dim wdDoc As Word.Document = wdApp.Documents.Open("C:\test.doc")
End Sub
End Module

For the problem about how Distiller or PDF Writer handle the Printer issue,
I think you may try to contact Adobe for detailed information.
Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! -
This posting is provided "AS IS" with no warranties, and confers no rights.


convert word document to pdf programmatically in

Post by Steve Rind » Sat, 04 Jun 2005 01:55:27

As Peter's mentioned, in some cases you can simply print to the Distiller
instance (manually or via VBA) to get a PDF. Problem is that this either pops
up a dialog box asking the user to name the file or it puts the file wherever
Distiller pleases under the name it chooses.

To get around this you need to automate printing to file on a PS printer driver
then automate Distiller to process the file.

A google on "automate distiller" should get you started.

The details may change with each version of Distiller. Caution.

Steve Rindsberg, PPT MVP