Re: Word Mail Merge with a Table
From: Peter Jamieson (pjj_at_KillmapSpjjnet.demon.co.uk)
Date: 09/01/04
- Next message: Peter Jamieson: "Re: Word 2000/2002 - Proper Mail Merge steps for ODBC?"
- Previous message: Tony_VBACoder: "Re: Word 2000/2002 - Proper Mail Merge steps for ODBC?"
- In reply to: Tony_VBACoder: "Word Mail Merge with a Table"
- Next in thread: Tony_VBACoder: "Re: Word Mail Merge with a Table"
- Reply: Tony_VBACoder: "Re: Word Mail Merge with a Table"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Sep 2004 18:52:07 +0100
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.
-- Peter Jamieson "Tony_VBACoder" <anonymous@discussions.microsoft.com> wrote in message news:430901c4903a$0120b480$a601280a@phx.gbl... > 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.
- Next message: Peter Jamieson: "Re: Word 2000/2002 - Proper Mail Merge steps for ODBC?"
- Previous message: Tony_VBACoder: "Re: Word 2000/2002 - Proper Mail Merge steps for ODBC?"
- In reply to: Tony_VBACoder: "Word Mail Merge with a Table"
- Next in thread: Tony_VBACoder: "Re: Word Mail Merge with a Table"
- Reply: Tony_VBACoder: "Re: Word Mail Merge with a Table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|