Re: Word Mail Merge with a Table

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Peter Jamieson (pjj_at_KillmapSpjjnet.demon.co.uk)
Date: 09/01/04


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.


Relevant Pages

  • Re: HTML code is showing up
    ... This database has tables that have been around for a very long time. ... know thy limits....know thy newsgroups! ... Then double-check that the Text Format of the property in the form is plain text. ... If that is the case, when you create a report, the text box on the report should have its Text Format property set automaticallly for you. ...
    (microsoft.public.access.reports)
  • Re: Updating database from remote location
    ... To keep it simple they should export the data in a known format. ... >I have built a database for local squadrons so they can create their status ... > reports for their boss at the Wing (Navy squadron chain of command). ... > do not have access to the same network in order to complete their report. ...
    (microsoft.public.access.externaldata)
  • Re: HTML code is showing up
    ... Compact the database. ... This might mean creating another text field in your table, populating it with an Update query, deleting the old one, compacting the database, and then renaming the field back to the old one again. ... Then double-check that the Text Format of the property in the form is plain text. ... If that is the case, when you create a report, the text box on the report should have its Text Format property set automaticallly for you. ...
    (microsoft.public.access.reports)
  • RE: updated numbers in report
    ... for making an input to the database. ... textbox will be located alongside with the combobox where the belonging ... belonging query for the report. ... ElapsedTime([Date First Time Onboard], ...
    (microsoft.public.access.dataaccess.pages)
  • Re: Need Help in formatting a report
    ... In the database you provided the link for, in the other thread, generated an error due I think to trying to stick 01.03.2006 (a non-standard date format, not recognized as an actual date by Access) into a date field. ... What I would like is to create a report that will display each employee's ... with a sample database, and report. ...
    (microsoft.public.access.reports)