News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • automatic pdf creation in Word

    Posted on WSslang Comment on the AskWoody Lounge
    Viewing 2 reply threads
    • Author
      Posts
      • #351619 Reply
        WSslang
        AskWoody Lounger

        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.

      • #510418 Reply
        WSmahassall
        AskWoody Lounger

        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 Reply
          WScpod
          AskWoody Lounger

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

      • #510476 Reply
        WSartAlexion
        AskWoody Lounger

        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 2 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: automatic pdf creation in Word

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