Access Report exporting and merging to Word/PDF

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WesleyN
    New Member
    • Jul 2012
    • 7

    #1

    Access Report exporting and merging to Word/PDF

    I try to Export and Merging Access Reports, some in table-format = with lines, and some with graphics. But I only can generate text documents.

    What do I have to do to export these reports to Word in the right format?
    And if I merged the generated document. Is it possible to save this document in the right format as a PDF-document?

    I found some code like this: wordApp.ActiveD ocument.SaveAs strOutputFileNa me, wdFormatPDF, ...

    Thank you Wesley
  • MarkP2012
    New Member
    • Jul 2012
    • 4

    #2
    look at the docmd.OutputTo command. More specifically, the OutputFormat parameter of the command. That will let you save the report in:
    acFormatASP
    acFormatDAP
    acFormatHTML
    acFormatIIS
    acFormatRTF
    acFormatSNP
    acFormatTXT
    acFormatXLS
    acFormatXLSX
    acFormatXLSB
    acFormatXPS

    But I know PDF is available. I have an app using:

    Code:
    DoCmd.OutputTo acOutputReport, pReport, acFormatPDF, TempVars!reportfilename, pPreview
    Last edited by NeoPa; Jul 14 '12, 10:02 AM. Reason: Changed the BOLD tags to CODE tags. The CODE tags button is <CODE/> in the editor window ;-)

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      WesleyN

      Which version of Access are you using?

      MarkP2012 will certainly work... if you're using MS office 2010... we skipped 2007 due to a lot of user complaints about the ribbon and missing features like exporting to Excel; thus, I don't know if the pdf format is available directly from MSAccess 2007 - but I do remember reading that you had to download an add-in or it was available after one of the service packs so I am fairly certain that is not a basic option in 2007 (*).

      In both 2007 and 2010 there have been some major gripes about the inability to take the reports designed in Access directly to either Word or Excel while maintaining the formating... IMHO, frankly a major mistake on MS. In 2010 there is an option to take the report to a PDF document and, for me, it has held the formatting nicely. There are however automation commands and other workarounds for getting a report to a word document.

      (*) There are also free or shareware type pdf printer drivers that you can install on the PC that will handle this too.


      -z

      Comment

      • WesleyN
        New Member
        • Jul 2012
        • 7

        #4
        I've solved this with two external components. I'm using now PDFSharp (open source) and PDFFocus (shareware) via a small .NET tool.

        MS Access doesn't work good enough with Excel and Word.

        You can adding references with Word and Excel. But you have to make templates for the borders. And I had too few time for doing that.

        I know the function OutputTo. But you can only export text to Word and Excel. And for PDF, you can only export single Reports. A snapshot (SNPFormat) makes a picture of your report.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          Sounds like you were/are using 2007.

          Comment

          • WesleyN
            New Member
            • Jul 2012
            • 7

            #6
            That's correct. But I can't change this solution.

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              I know that you have a solution with the pdf printer; however, I've found some information about automating word from within Access... Honestly, I haven't done this as we went directly to 2010 which allows direct pdf creation of the reports; however, although written for 2000, the following might be useful: http://www.databaseadvisors.com/news...mationlpt1.asp

              -z

              [edit] here's one using an exsiting document: http://www.applecore99.com/gen/gen033.asp
              Last edited by zmbd; Jul 19 '12, 12:59 PM. Reason: added part two of the refered article.

              Comment

              Working...