• DoCmd.TransferText (2000)

    Author
    Topic
    #390237

    Is it possible to have a report saved as a word file ? (from a vba button)

    From looking at the DoCmd.TransferText command, it should be possible to output a Rich text file. but the syntax is slightly confusing, and seems to suggest that you can only transer a query, rather than a report.

    Viewing 0 reply threads
    Author
    Replies
    • #692408

      Indeed, TransferText can only be used to export tables and queries. To export a report, use DoCmd.OutputTo, for example:

      DoCmd.OutputTo acOutputReport, “rptMyReport”, acFormatRTF, “C:SteveReport.rtf”

      If you omit the file name, Access will prompt the user to supply one.

      Warning: exporting a report to .rtf leaves a lot to be desired. All graphics (including horizontal lines) will be lost, and the text and page layout may not be perfect. One tip: make the text boxes on the report a little wider than necessary for on-screen display.

      • #692589

        Thanks Hans,

        I had figured that .rtf was the only thing i was going to be able to get, like you say, the drawn horizontal lines are gone, but its no biggie really.

        In the future i’m sure we will see programs have the ability to move any data in one format to any other at the click of a button. yep

        • #692652

          You can already move a report into PDF format complete with graphics, but it takes a bit more than a click of a button behind the scenes. There is a whole range of inexpensive software available to facilitate writing to PDF files.

    Viewing 0 reply threads
    Reply To: DoCmd.TransferText (2000)

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

    Your information: