View Single Post
  #8   Report Post  
Charles Kenyon
 
Posts: n/a
Default

It is a field on the header footer AutoText menu or available through Insert
Field.


You can put the field into your merged document but it will not show a
correct name and path until after the document is saved and the field is
updated. If in a header / footer it will generally be updated when you print
or do a print preview. If in the body, you'll need something that updates
your fields.

I had thought you could put it in the primary merge document before the
merge, but checked when I read Graham's post and was mistaken. Word converts
the field to text during the merge. (The primary way I use mail merge is to
merge to the screen for a single client. I then print and save the merged
document, with active fields. So putting it in the primary merge document
works for me. I realize that most people actually perform a merge for
multiple files.)

It should be relatively simple to put together a processing macro that (1)
performs the merge, (2) saves the result document, (3) inserts the field you
want (which will then be correct when inserted), and then saves the document
again. This could be put on a (floating) custom toolbar for your users to
perform the merge.

The following is the command to insert the field.
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:= "FILENAME \p ", _
PreserveFormatting:=False

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Karen Hart" wrote in message
nk.net...
By just inserting the path/filename merge code?

"Charles Kenyon" wrote in
message ...
You can insert the field for this but realize it won't give a real name
until after the document is saved and the field is updated.
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Karen Hart" wrote in message
ink.net...
Thanks so much, Graham. You dah man!
Is there a similar function for the document id code? To insert the new
name and path of the resulting merged document?

"Graham Mayor" wrote in message
...
Use a CREATEDATE field for the date and merge to a new document. The
new
document will always show the date of the merge.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Karen Hart wrote:
How do I create a form file that upon merging inserts the current
date of the merge, then does not update after that point? In other
words, after the merge is complete, the resulting document's date
field should be automatically unlinked. I do not want to teach the
user to unlink the field with Ctrl-Shift-F9, because there are
several of these date codes throughout the form file, inlcuding
headers and footers, and also I don't want to risk that the user
forgets to unlink the date field.

Thank you in advance.
Karen