Converting word doc's to pdf with VB

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Venkat Shiva Reddy (venkat5768_at_yahoo.com)
Date: 06/05/04


Date: Fri, 4 Jun 2004 23:31:01 -0700

What's wrong with this code, it's creating 0 bytes size pdf file. Is their any other way to convert .doc to .pdf with VB code, i have Acrobat distiller installed in my comp.

Private Sub btnConvert_Click()
Dim msWord As New Word.Application

msWord.Visible = True
msWord.ActivePrinter = "Acrobat Distiller"
msWord.Documents.Open App.Path & "\test.doc"
msWord.ActiveDocument.PrintOut , , , App.Path & "\test.pdf"
msWord.ActiveDocument.Close False

' Should check and quit word when done
msWord.Quit False
Set msWord = Nothing
End Sub



Relevant Pages

  • printing to PDF file from DOS apps via LPT1
    ... I need to print to PDF file. ... I have a adobe acrobat distiller installed and tried following after making ... I see that a print job went into acrobat distiller printer ...
    (microsoft.public.windowsxp.print_fax)
  • printing to adobe acrobat pdf file from DOS lpt1
    ... I need to print to PDF file. ... I have a adobe acrobat distiller installed and tried following after making ... I see that a print job went into acrobat distiller printer ...
    (microsoft.public.win2000.printing)
  • Re: pdf converter within Word VBA
    ... No PDF file converters available in pre Office12 versions. ... There's is however a way to produce PDF files, using the Acrobat Distiller ... the following example from msdn of a Wordperfect converter describes. ... Dim fmt As Variant ...
    (microsoft.public.word.vba.general)
  • Re: printing to PDF file from DOS apps via LPT1
    ... > I need to print to PDF file. ... > I have a adobe acrobat distiller installed and tried following after ... Printfil - Windows Printing System for Applications ...
    (microsoft.public.windowsxp.print_fax)