Results 1 to 10 of 10
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exporting report data to word (A2k2)

    Hello All,
    I would like to try generating reports in word instead of using Access reports. The main reason is to get better looking paper and electronic forms. I would also like to use Word templates, thinking that it would be easier to open new documents. Has anyone done this sort of thing before? Oh, I will only be generating one record/form at a time.

    Thanks,
    Mark

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

    Re: Exporting report data to word (A2k2)

    You can produce excellent-looking reports and forms in Acces itself. The only reason I see for creating a report in Word is to be able to edit it afterwards - exporting an Access report to Word is no good, the results are usually horrible.

    One way to do this is via mailmerge:
    - Create a query in Access that returns all variable pieces of text as fields.
    - Create a new tamplate in Word
    - Make it into a mail merge document with the query as data source.
    - Edit it - enter fixed text, insert merge fields where necessary.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Exporting report data to word (A2k2)

    I agree with Hans about Access reporting - for one thing you can precisely position a control on an Access report quite easily, but it's a much more daunting task in Word. In addition, it's almost impossible to create something that works like a subreport, or especially a nested subreport, in Word. On the other hand, there are some things that can be done in a more elegant fashion, and Word documents are more likely to be readable on a users workstation since most people have it installed. In addition to mail merge as Hans suggests, you can use Automation to create Word documents. It means digging into VBA and the Word object model however. The Access Developers Handbook has a good section on it, and there are several Knowledge Base articles that can be found by searching for "automation" under the Access 2000 section. Also <!profile=carbonnb>carbonnb<!/profile> has posted some articles on the subject and one of these days we will have an Automation tutorial on our website. Is this a continuation of your <post#=200648>post 200648</post#>?
    Wendell

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting report data to word (A2k2)

    Thanks Hans and Wendell,
    Yeah, This is one thing I am picking up again since last November. I agree that the Access report generator puts out some nice looking documents. However, these documents need to be read by people that will receive them via e-mail, hence the current method of saving as RTF type of files. The problem is that the RTF's don't retain all of the formatting like inside Access and graphics don't seem to stay either (Company logo). So, this is why I was pursuing something else. It sounds as if a mail merge may be the correct way to do this. Can all of this be done from inside Access? Or does it require the user to open Word to start the process?

    I will look up those posts on automation.

    Thanks again,
    Mark

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting report data to word (A2k2)

    Mark,

    You can do everything from within Access. Access will open Word for you, do the merge or run the automation code and close down Word as well (if you tell it to)

    Other Options are to save the Access report as a Snapshot format, but the receiver will need the Sanpshot viewer installed.

    You could also print the report to a PDF and e-mail the PDF.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Exporting report data to word (A2k2)

    As Bryan notes, it can all be done in Access, and the (Access) user doesn't even need to know you are doing a merge. You may find this tutorial to be a useful starting point - if not please send us some feedback.
    Wendell

  7. #7
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Exporting report data to word (A2k2)

    ... of course to print to a PDF, you need to have a copy of adobe running. I recently heard that it may be possible to print to a PDF or create a PDF from access without having Adobe installed. Any ideas if this is true?
    Regards,

    Gary
    (It's been a while!)

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

    Re: Exporting report data to word (A2k2)

    There are several lowcost or shareware products out there that will write to PDF format files, in addition to the Adobe products. You need Adobe Acrobat to edit PDF files, but they can be written without it. If you do a Lounge Search on PDF, you should turn up a number of threads on the topic. To get you started, you can also take a look at http://www.win2pdf.com/.
    Charlotte

  9. #9
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting report data to word (A2k2)

    Thanks Bryan,
    I am now getting around to this task. I installed Acrobat on my machine and would like to explore printing the Access report as a PDF. The entire scenario is that I need to name the file based on code that is running, and store it in a specfic location. How would I do this from the code? I currently use the outputto method to run a report and output that to RTF. The problem with RTF is that it drops the company logo, which I need to keep.

    Thanks,
    Mark

  10. #10
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting report data to word (A2k2)

    Mark,

    I have never automated Acrobat like this before. I seem to recall reading that there is either a registry key or an INI file that can be set that can be set to tell Acrobat where to write the file.

    Other than that, I have no idea. Maybe someone else will know.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

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