Is it possible to link/export a query to a existing Word document?

Arcadia

Registered User.
Local time
Today, 04:22
Joined
Jan 25, 2013
Messages
66
Like the title says it:

Is it possible to link/export a query to a existing Word document?

I have several Word documents with text, and i want to place the data of a few query's in those documents in a certain place.

Is this possible true vba or another way?? :rolleyes:
 
Word Mail Merge - this is what comes to my mind when you describe the scenario.
 
A regular "Mail-Merge" from within Word, sourcing from an Access Query, would probably be difficult if not impossible.

I've done quite a bit of mail-merges and I do not recall ever seeing this option as a source of field data.

On the other hand, there is no question in my mind that it could be done from within the Access database by referencing the Word object model in the VBA project.

Depending on your scenario, you could create templates in Word, with the fields present and then open/edit those templates from within Access using the Word Object Model.

Alternatively and probably the easiest way (without any special Word object Model coding), you could also, create a report in Access that would have all the content you desired, including text and fields, right in Access and then "print" it to Word and you'd have your exported Word document.

There are numerous ways to do this, but honestly, as a mail merge from Word-sourced from a query, I would not advise it (no offence pr2-eugin).
 
well, before anybody else does it, I'll spank myself.

Bad Bilbo, bad bilbo.

I actually went and opened Word and doulbe checked and it actually will pull up queries as a source.
I thought it would only do tables.

Message to self, check it out before inserting your foot in mouth...

Sorry...
 
no offence pr2-eugin
None take ! :)

After all we are here to learn, however I would have to point that MS Access comes with a functionality to perform mail merge with a few clicks of a button. From the description of the OP, all that's needed was a simple Merge. Hence my reply. The following link explain this

http://office.microsoft.com/en-gb/a...-as-a-mail-merge-data-source-HA001233657.aspx

Alternatively, you could also open the Word document select the source form an Access DB (Query inside the Access DB), this can be found in: http://www.functionx.com/mailmerge/access.htm

The method you are explaining is Automation of Mail merge from Access (manipulating a Word object from within Access). There was no mention of Automation, if it did and I missed it, I have to apologize, Word Mail Merge from Access would not be the option (although does the exact same thing, but without any human interaction).

I do my Word Mail Merge automation. This involves a bit of coding, I am sure there is one floating around in the internet, also could be found on Albert Kallal's website - http://www.kallal.ca/msaccess/msaccess.html (although not sure if it was updated to be run with A2003+), but I use my own.

If I have caused any troubles, I am sorry Arcadia ! Good luck !
 

Users who are viewing this thread

Back
Top Bottom