Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2004

Tip: Looking for answers? Try searching our database.

Word Mail Merge with a Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony_VBACoder - 01 Sep 2004 16:40 GMT
How can I get a Mail Merge Word Document to display data
in a Table where the data comes from an Access database?

I have a Word Mail Merge Letter that has the following
sample format with the following Merge Fields from an
Access Database Query that has all the data needed for
this letter.  My sample Merge Fields are within the < >
characters:

+++ Sample Letter below  +++++++++++++++++++++++++++

<First Name> <Last Name>
<Mailing Address>
<City> <ST> <ZipCode>

Dear <Saluation>:

The following items are in your order:

**** Here I want to add a Table with their orders ****
Order #   Order Date  Desc  Amt  Total
-------   ----------  ----  ---  -----
11111     4/1/2004    X      3    10
22222     5/1/2004    Y      5    20
33333     6/1/2004    Z      7    30

Thank you for your order.

++++++++++++++++++++++++++++++++++++++++++++++++++++

Does anyone have any idea if this can be done?  I can do
this within Access, but wanted to know if this can be done
within Word 2000/2002?  This would be similar to creating
a Main Report with a Sub Report containing the Orders,
within Access.
Peter Jamieson - 01 Sep 2004 18:52 GMT
It's simpler using Access reporting (I am told!) Word is not really set up
to do this. You can try using a DATABASE field to insert the table, using a
nested { MERGEFIELD } field to filter the results so that you only get the
items belonging to the current order. But it's very difficult to control the
format of tables inserted using DATABASE.

If you are using Word 2002 or 2003, the "official" way to do many things
that the built-in merge can't manage is to use VBA and the Mailmerge events.
This lets you modify the Mail Merge Main document before each record is
merged. So you could, for example, use VBA and ADO to get the appropriate
data from the database, insert it in tabular format and format it. However,
once you have gone that far, it may be simpler to "roll your own" merge,
using Word Automation to process the data from each order in turn and insert
it in the correct places in a fresh copy of your "mail merge" template.

Signature

Peter Jamieson

> How can I get a Mail Merge Word Document to display data
> in a Table where the data comes from an Access database?
[quoted text clipped - 31 lines]
> a Main Report with a Sub Report containing the Orders,
> within Access.
Tony_VBACoder - 01 Sep 2004 21:50 GMT
Peter, that is what I thought.  I may just go ahead and
keep this an Access report, because I can code the report
in about 10 minutes, whereas, it would be much more
difficult in Word.

Thanks.

>-----Original Message-----
>It's simpler using Access reporting (I am told!) Word is not really set up
[quoted text clipped - 49 lines]
>
>.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.