View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default directory mail merge: auto pop-up template for the final listing??

In the last step, however, I can only select
'merge into a new document'.


Yes, this is the only option for directory merges.

However we do this a lot... Can I create a template that will be used for
the final document? Can I use database fields in this template?


You can do this, but
a. it is not trivial to include headings that are only displayed at the
beginning of the merge (or at the top of each page).
b. in my view, it is inadvisable to connect the template to the data
source, unless the data source is fully multi-user, e.g. a SQL Server
database.

I know it must be possible because we have a demo template, that
automatically opens a document with a dummy logo, some more information
and
presents a list of the merged rows. However I cannot see anywhere where I
can
EDIT or MODIFY this template.


A template can either be
a. a real Word template (.dot file), in which case you would typically
create a new Mail merge document using File|New and selecting the template
you want from the dialog. Word creates a copy of the template as a .doc file
and leaves the original untouched.
b. a Word document (.doc file), in which case you (or your users) have to
be a bit more careful not to overwrite the original document.

To edit a template (.dot), you first have to locate it. Templates can be in
various places - look in Word Tools|Options|but for example mine are in

C:\Documents and Settings\my windows login name\Application
Data\Microsoft\Templates

- you would need to substitute your own login name to create the correct
path.

To edit a template, use File|Open to navigate to the correct folder and open
the .dot file. You may need to change the settings in Windows
Explorer|Tools|FolderOptions|View to do that.

Earlier I said:

You can do this, but
a. it is not trivial to include headings that are only displayed at the
beginning of the merge (or at the top of each page).
b. in my view, it is inadvisable to connect the template to the data
source, unless the data source is fully multi-user, e.g. a SQL Server
database.


The reason for (a) is that all the fields and text you put in the mail merge
main document are repeated for /every/ record in the data source. If for
example, your directory has a single row table, then to have headings, you
need a heading row n the table. But this is repeated for every record, and
there is no way to make it only appear above the first record. If you do not
use a table, you can use an IF field to insert fields and text that will
only appear above the first record, but in recent versions of Word, this
sometimes seems to cause problems. You can also put headings into the
document header and they will of course be repeated for each page. The
alternative is to add them after the merge, and a fairly easy way to do that
is to keep the headings you need in a separate file and use File|Insert to
insert it.

The reason for (b) is that in recent versions of Word, when you create a
mail merge main document based on a template that has a data source
attached, Word tries to open the data source again when it creates the
document based on the template. It cannot always do that because of locking
issues. A possible workaround is not to have the template connected to a
data source, and to use a VBA AutoNew macro to set up the data source.

Peter Jamieson
"Ido" wrote in message
...
Hi,

This is a pressing issue. I got as far as connecting to the database and
creating the record lines. In the last step, however, I can only select
'merge into a new document'. The result of this is a simple list of all
records on one page. I then have to manually have to add header, footer,
logo
etc.

However we do this a lot... Can I create a template that will be used for
the final document? Can I use database fields in this template?

I know it must be possible because we have a demo template, that
automatically opens a document with a dummy logo, some more information
and
presents a list of the merged rows. However I cannot see anywhere where I
can
EDIT or MODIFY this template.

If anyone has a clue how to achieve this please let me know... both how to
create a new template and edit/modify the example one I have...

Thanks for your help!