going crazy - need help with INCLUDETEXT!!!

U

unfrostedpoptart

Help!

I need help getting INCLUDETEXT to work. I'm pretty new to Word
(using 2000 & 2003), but I've been doing large, multi-file, technical
documents in FrameMaker for many years. I've inherited an old
document that needs lots of updating. It includes a couple dozen
other Word docs using the INCLUDETEXT field. I've been going crazy
for over a week trying to get the field to work right - once in a
while it does what I want, but the rest of the time, even though I'm
doing the exact same thing, it doesn't.

Details:
I'm working in Outline Mode, showing the field codes. All the
includes looked like this (which I have to type, because I also can't
figure out how to copy and paste the field codes - it just replaces it
with the included doc.)

+ { INCLUDETEXT "FILESNAME.doc"
[] }

Note: [] is my ASCII version of the little square symbol.

This works when I toggle field codes. Two big problems: First, I
need to change the included docs. I tried just selecting the filename
and changing it, but that didn't work. It just ignores the change! I
tried right-click, accept changes, but that didn't help.

Second, I tried entering in new field codes with Insert->Field. I
select INCLUDETEXT and enter the filename and also de-selected
Preserve formatting during updates (not that this had any effect).
Once in a while it puts in something that looks like the above
example, with the extra little square for body text. When it does
this, the field works and I can toggle show-fields and see the
included document. However, most of the time it looks like this:

- { INCLUDETEXT "FILESNAME.doc"}

and when I try and toggle show field codes it just says

Error! Not a valid filename.

And, yes, it is the correct filename. What is going on? This used to
work and still does about 1% of the time. What don't I know?

Many thanks!

David
 
M

macropod

Hi David,

First off, Word's help file explains the INCLUDTEXT field's usage pretty well.

OK, so you want to change the filename. From your description it sounds like you've done everything except update the field after
making the change. Simply changing the filename without updating the field isn't enough. Select the field and press F9 to update it.

As for the square symbol you described, I can't see any reason for it being there. Usually, the only thing I'd expect to see after
the filename is a bookmark name (if you're linking to a bookmark in the source document), and whatever field switches you're using.

The other thing that seems to be missing from your field is the source filename's path. Sometimes you can get away without it, but I
think you have to be adding the field to a document that's already been saved and have the source file in the same folder. Note that
deleting the path from an existing field doesn't change the path Word uses to find the file.

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------

unfrostedpoptart said:
Help!

I need help getting INCLUDETEXT to work. I'm pretty new to Word
(using 2000 & 2003), but I've been doing large, multi-file, technical
documents in FrameMaker for many years. I've inherited an old
document that needs lots of updating. It includes a couple dozen
other Word docs using the INCLUDETEXT field. I've been going crazy
for over a week trying to get the field to work right - once in a
while it does what I want, but the rest of the time, even though I'm
doing the exact same thing, it doesn't.

Details:
I'm working in Outline Mode, showing the field codes. All the
includes looked like this (which I have to type, because I also can't
figure out how to copy and paste the field codes - it just replaces it
with the included doc.)

+ { INCLUDETEXT "FILESNAME.doc"
[] }

Note: [] is my ASCII version of the little square symbol.

This works when I toggle field codes. Two big problems: First, I
need to change the included docs. I tried just selecting the filename
and changing it, but that didn't work. It just ignores the change! I
tried right-click, accept changes, but that didn't help.

Second, I tried entering in new field codes with Insert->Field. I
select INCLUDETEXT and enter the filename and also de-selected
Preserve formatting during updates (not that this had any effect).
Once in a while it puts in something that looks like the above
example, with the extra little square for body text. When it does
this, the field works and I can toggle show-fields and see the
included document. However, most of the time it looks like this:

- { INCLUDETEXT "FILESNAME.doc"}

and when I try and toggle show field codes it just says

Error! Not a valid filename.

And, yes, it is the correct filename. What is going on? This used to
work and still does about 1% of the time. What don't I know?

Many thanks!

David
 
U

unfrostedpoptart

Hi David,

First off, Word's help file explains the INCLUDTEXT field's usage pretty well.

OK, so you want to change the filename. From your description it sounds like you've done everything except update the field after
making the change. Simply changing the filename without updating the field isn't enough. Select the field and press F9 to update it.

As for the square symbol you described, I can't see any reason for it being there. Usually, the only thing I'd expect to see after
the filename is a bookmark name (if you're linking to a bookmark in the source document), and whatever field switches you're using.

The other thing that seems to be missing from your field is the source filename's path. Sometimes you can get away without it, but I
think you have to be adding the field to a document that's already been saved and have the source file in the same folder. Note that
deleting the path from an existing field doesn't change the path Word uses to find the file.


Thanks for the help. It sort-of works, but it's still not making
sense. First, the path thing: the original document used absolute
paths. In order to simplify things, I put everything in one directory
and removed the paths. For some documents this is fine, but for some
of them it doesn't, and I had to put back in the path! Then, to be
even weirder, once it worked with the full path, I then removed
everything but the filename, updated the field, and it still worked!
This is what I had (not working) in the first place!

I also don't understand why sometimes it inserts a lower-level
paragraph with empty body text and sometimes it doesn't.

David
 
M

macropod

Hi David,

Deleting the filepaths doesn't change where Word looks for the files - the only way to do that is to provide a new path (which
you've now done).

As for the 'lower-level paragraphs', I suspect this is something to do with that square character you referred to acting as a
bookmark reference of some kind. Try deleting them and see what happens.

Cheers
 
U

unfrostedpoptart

See if the discussion of FilePaths on this page helps at all (jump to
appropriate subsection):http://word.mvps.org/faqs/tblsfldsfms/includetextfields.htm

Thanks - this has lots of good info. I'm still seeing somewhat flaky
behavior, but I think this part of the document explains it:

***************************************************************************************
When Word sees a relative filepath in a document, instead of checking
the filepath against the filepath of the document, Word uses the
currently active folder to check the relative filepaths. For instance,
if you opened the target doc, then opened the source doc, Word will
measure all filepaths against the source doc, as that is the currently
active folder. In the target doc, your relative filepaths will
suddenly stop working and will show Error! Cannot open file. If you
only open the target doc, however, or reopen the target doc after
opening the source doc, the relative filepaths will work fine after
updating them. Again, always be sure to update fields regularly, as
sometimes everything will look okay but fail when you attempt to
update it. Or vice versa-updating can fix a field that looked entirely
incorrect.

The really annoying thing about this behavior is that it's guaranteed
to be intermittent. It will only cause a problem some of the time. You
can go through the same actions, and sometimes all your links will
fail, and sometimes they won't (since most of us don't pay attention
to the invisible setting for the currently active folder in Word).

Workaround 1: use relative filepaths, but go into File>Properties and
set a "hyperlink base" for the document. Then Word should read all
relative filepaths from that base, instead of checking against the
currently active folder.

Workaround 2: use absolute filepaths, but create a custom document
property to store the base filepath (File>Properties>Custom). Then use
a DocProperty field to carry the path info into the IncludeText
fields. You can easily change the custom document property in
File>Properties. The nested fields might look like this:

{ INCLUDETEXT "{ DOCPROPERTY LinkFilePath }Source.doc" Bookmark }
***************************************************************************************

I'll have to try some of these advanced workarounds. I wish we could
just use FrameMaker!

Thanks,

David
 

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