Word "INCLUDETEXT" changes the filename

R

ritterhaus

I've seen postings on this going back as far as 2002, but never found a
efinitive answer. Microsoft doesn't seem to address this in their
knowledge base, yet this appears to be an old problem. Here's the
scoop...

Lawyer is using Word XP and has a master document with boilerplate
text, we'll call it master.doc. He creates 20 or so "child documents"
that must include some of the text from the boilerplate. He goes
through the master and creates a bookmark for each section of text he
wants to use as a unit.

In the child documents he includes the boilerplate with the following:

{ INCLUDETEXT "master.doc" BookmarkName }

He IS doing this correctly, because the field is replaced with the
proper text and all is right with his world.

At some later point (it doesn't seem to matter whether he has closed
the document and reopened it) he refreshes the field. SOMETIMES (it
happens often, but not predictably) the field now reads "Error! Not a
valid file name." Toggling the field text reveals that the field now
reads thus:

{ INCLUDETEXT "master.doc BookmarkName" }

Note that the bookmark has been added to the file name, so that now the
filed points to a non-existent file (hence the error.) Manually
"fixing" the field does not work - Word continues to mangle the name
until the original document is renamed and the field modified to
reflect the new name.

No files have been moved, no paths changed, all the documents are in
the same directory, etc. The fact that Word will not accept even a
manual change to the field wthout renaming the file is particularly
disconcerting.

Does anybody have any information on this? And how to fix this?
 
P

pbnyc

I have precisely the same problem which I've never been able to describe so
eloquently. Thank you. It's a shame no one has responded. Every answer I've
ever heard to this question never quite admits that this is a bug, but it
very clearly is, and it's also very clearly a show-stopper in terms of using
Word + Access as a reliable solution for the creation of mission critical
documents. Answer I've heard always focus on user's not getting the
connection right, but as stated, this still happens when nothing has changed.
I mean nothing but opening and closing the Word file. And what about the
mangled field code? It's not as if the postition of a quotation mark plays
any kind of significant role here is it???
 
P

Peter Jamieson

I have to tried to replicate this problem but have not seen it so far. That
might just mean that my data is not sufficiently large or some such. But
here are a few questions:
a. which versions of Word exhibit this problem? ("Ritterhaus" mentions Word
XP - have you also experienced it on Word 2003? 2000? etc.)
b. does it appear to make any difference how the INCLUDETEXT is
constructed? e.g., in the example given it seems very simple:

{ INCLUDETEXT "master.doc" BookmarkName }

In this example, I am assuming that
i. master.doc is a piece of plain text, not the result of a MERGEFIELD
field
ii. BookmarkName is the result of a MERGEFIELD field. Is that correct? Does
the bookmark name ever
iii. there are no quotes around BookmarkName (according to Word Help, they
are not part of the INCLUDETEXT syntax so that should be OK). Does it make
any difference if BookmarkName is quoted?

However typically you would need path information, or the INCLUDETEXT would
either resolve correctly or it would not depending on what Word considered
its current folder to be. e.g. if you open the mail merge document, then
open a document in another folder, then refresh the INCLUDETEXT field, you
will probably see an error. The question is, does the reported problem only
occur if no path is present, a path is present, or does it make no
difference?

d. is there only a single INCLUDETEXT in problem documents?
e. If you move the entire application to another PC, does the problem still
occur? The chances of having a problem recognised and investigated are
obviously very much higher if you can provide an example which goes wrong
sometimes, even if you can't get it to go wrong to order. (I think you would
have to go via Microsoft PSS to get any action on this though).

Peter Jamieson
 
C

Cheryl Cavanaugh

I am a different user, but have the exact same problem. I have the code:

{ INCLUDE TEXT: "C://Program Files//Ecorp//Letterhead.dot" }. This pulls in
our client's letterhead into master letters (not meaning a master document as
defined by word - just a precedent). It works like a charm in the office,
but on the client's site, the path and file name change to something
COMPLETELY DIFFERENT and changing it manually makes no difference whatsoever.
Oddly, or perhaps not oddly, I don't know, it retrieves the letterhead our
client has stored on their own system - not the right letterhead by any
means, but it is a letterhead, but different name! BIZARRE! How can I keep
this from happening?
 
C

Charles Kenyon

Lawyer is using a electric drill when should be using a chisel. IncludeText
is the the electric drill, AutoText is the chisel.
--
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.
 
C

Charles Kenyon

I haven't had such a problem and have been using letterhead with borrowed
parts for more than ten years.

Simplest way is AutoText. I don't use it anymore for the same reason I
wouldn't use an IncludeText field. I want my historical documents (the
electronic copy of paper documents) to be the same as they were sent out.
That means I don't want them dynamically updating. You can use IncludeText
or AutoText fields and then unlink the field after insertion, I suppose.
Instead, I use a macro in my letterhead templates that grabs the current
letterhead elements (as well as styles) from a primary letterhead. If I were
still using AutoText fields, I would have the AutoText entry in a separate
global template to make it easier to update/share. See
http://addbalance.com/word/movetotemplate.htm for step-by-step instructions
on moving / sharing / copying / backing-up customizations including
AutoText, AutoCorrect, keyboard assignments, toolbars, macros, etc.



Nevertheless, I have never seen the bug you are reporting and can't
reproduce it.
--
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top