• automatic pdf creation in Word

    Author
    Topic
    #351619

    Hi All,

    I would like to create pdf files automatically from within VBA code in Microsoft Word using the distiller printer driver. To make matters a little more complicated, I would like the PDF file to be created in the same directory as where the originating Word document exists with absolutely no intervention on the part of the user.

    I seem to be having a problem using the PrintOut method and determining what the filename parameter needs to be.

    Any help would be appreciated.

    Viewing 1 reply thread
    Author
    Replies
    • #510418

      Hi Steve,

      I do the following from VBA:

      ActivePrinter = “Acrobat Distiller” ‘ (or its exact name)
      Activedocument.Printout OutputFilename:=MyPrintFile, PrintToFile:=True

      You would have to set the variable “MyPrintFile” to the path and name you want.

      Hope this helps,

      Cheers,
      Margaret Hassall

      • #510493

        Can you tell me how to create a pdf from excel?

    • #510476

      I’m sure that I am missing something here, but why are you trying to reinvent the wheel? The PDFMaker.dot that comes with Acrobat 4.05 does a fantastic job that would take much knowledge of both VBA and Acrobat Distiller and the PDF Document Object Model to reproduce.

      The default installation of Acrobat 4.05 puts the PDFMaker.dot template on your computer. Admittedly, the PDFMaker for Excel is quite lame, but the Word version is fabulous.

    Viewing 1 reply thread
    Reply To: automatic pdf creation in Word

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: