Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd.TransferText (2000)

    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DoCmd.TransferText (2000)

    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.

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd.TransferText (2000)

    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. <img src=/S/yep.gif border=0 alt=yep width=15 height=15>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DoCmd.TransferText (2000)

    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.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •