Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Paste query results into Word (Access 2003)

    I would like to run about 20 queries on a database and paste the results of each query into a Word document.
    What is the simplest way to do this?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Paste query results into Word (Access 2003)

    Is this a one-off event or do you want to code it to happen automatically in future?

    I think the simplest thing is just to open each query, select all records, copy, to go Word and Paste.
    Regards
    John



  3. #3
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Paste query results into Word (Access 2003)

    I have done it manually already. But I will need to run it over and over again.
    So I need to find a way to export the results out to Word if possible.
    The only way that I can think to do this programmatically, is to step through the query/recordset and write each line individually.
    I was wondering if there is an easier way to paste all the details from the query like when I use copy/paste.

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

    Re: Paste query results into Word (Access 2003)

    Is the structure of the queries identical? If so, you could create a union query that combines the results of all queries, and export that to Word (it can be automated by using DoCmd.OutputTo).

    Otherwise, you could use Automation to control Word from Access. See WendellB's tutorial Automation 101 for a general introduction if you need one, and the attached code for an example of pasting a series of queries into Word.

Posting Permissions

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