View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word field stops working when launched from Access

The { filename } field is "resolved" when you merge so { filename \p }
should show the pathname of the mail merge main document.

If you need it to show the pathname of the output document, one thing
you can do is...
a. create a new .doc or .docx - let's call it c:\myfiles\pn.doc
b. insert a { filename \p } field in that document
c. bookmark that field - let's call the bookmark "pn"
d. put the following nested field in your mail merge main document

{ INCLUDETEXT "c:\\myfiles\\pn.doc pn }

e. do the merge
f. save the output document
g. select the "story" in the document that contains the { INCLUDETEXT
} field (e.g. if it's in the header, select the header
h. press F9 to update the field results. You may need to verify that
that has updated all the headers.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Andrew @ ISL wrote:
I've created a .dot template file (I've tried it with a .dotx template also
with the same issue) and am launching it from an Access database. The Word
template contains three fields: {FILENAME \* MERGEFORMAT} {DATE \@ "dd/MM/yy"
\* MERGEFORMAT} {PAGE }. The problem is as follows:

1) The database names the new document, saves it under the new name and
launches the Word template - and works fine
2) When the document opens, the DATE field and the PAGE NUMBER field work
fine and when you click on them they are still fields which will update as
normal.
3) The FILENAME field, however, is replaced with the name of the template -
not actually of the filename. Worse still, this is no longer a field name so
can't update with the new filename.

I've trawled the net and am baffled as to why this would be happening and
what I can do to fix it. Hope you guys are cleverer than me!

Regards,

Andrew