A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Word field stops working when launched from Access



 
 
Thread Tools Display Modes
  #1  
Old September 10th, 2009, 04:41 PM posted to microsoft.public.word.mailmerge.fields
Andrew @ ISL
external usenet poster
 
Posts: 1
Default Word field stops working when launched from Access

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
  #2  
Old September 10th, 2009, 08:10 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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

  #3  
Old September 11th, 2009, 09:20 AM posted to microsoft.public.word.mailmerge.fields
Andrew @ ISL[_2_]
external usenet poster
 
Posts: 2
Default Word field stops working when launched from Access

Hi,

Really appreciate your input, but although I can see this might get round
the issue, it doesn't solve it. Each time we create a new file from Access,
it's creating a new Word document and automatically placing it in a different
folder on the computer - these aren't mail merges that we're doing for
marketing campaigns etc. but are daily quotes to different customers.

So basically, all I want to do is make the {FILENAME \* MERGEFORMAT} field
in the document template stay as a field which will automatically update when
the file is created/saved - at present, when the merged document is launched
it becomes text so therefore doesn't update.

I think with your method it would end up as quite a task.

Thanks again.

A
  #4  
Old September 11th, 2009, 11:40 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Word field stops working when launched from Access

If I knew of a simpler method that did what you wanted I would have
mentioned it. Perhaps someone else will come along with one. However, I
can't change what Word does with fields when it merges, and in fact Word
does not usually update fields immediately before it /saves/ - i.e. if
the user has to type a file name in the Save As dialog, the filename
field is unlikely to be updated until you actually re-open the document,
and even then it may or may not be automatic.

But if no-one else can think of one either then you're stuck with "the
simplest workable approach," and what is likely to be "simple" depends
on what your workflow looks like, whether or not you are already
automating using code, who's doing what, and typically, what the user
thinks is simple.

One of the "simple" things about using fields is that you don't have to
deploy a VBA-based solution, but if you are already using VBA or it
would be easy for you to do so, it is probably simpler to think in terms
of inserting the pathname programmatically rather than using a field. if
that's what you want to do, I can certainly make some suggestions.

Peter Jamieson

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

Andrew @ ISL wrote:
Hi,

Really appreciate your input, but although I can see this might get round
the issue, it doesn't solve it. Each time we create a new file from Access,
it's creating a new Word document and automatically placing it in a different
folder on the computer - these aren't mail merges that we're doing for
marketing campaigns etc. but are daily quotes to different customers.

So basically, all I want to do is make the {FILENAME \* MERGEFORMAT} field
in the document template stay as a field which will automatically update when
the file is created/saved - at present, when the merged document is launched
it becomes text so therefore doesn't update.

I think with your method it would end up as quite a task.

Thanks again.

A

  #5  
Old September 11th, 2009, 12:46 PM posted to microsoft.public.word.mailmerge.fields
Andrew @ ISL[_2_]
external usenet poster
 
Posts: 2
Default Word field stops working when launched from Access

Hi Peter,

That's the conclusion/solution we've come up with as well - VBA.
Disappointing that MS didn't make it a bit easier on the Word front, though.

Thanks for your help!

Kind regards,

Andrew
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.