Can only update "INSERTTEXT" field once per file open

K

Kris

I have several documents that I am trying to organize.

Essentially I have a testing procedure for several types
of testers. Some steps are common, some are not.
The common steps are in one document (amazingly called
general_tests.doc) and the steps for each tester are in
their own documents accordingly.

I orginally tried to use Master Documents to do this, but
when I would include the general_test.doc into 4 or more
Masters, 1 for each tester type, it would corrupt the
other Masters.

After fighting with this for some time I read about the
"inserttext" field that I found by searching these forums.

My problem is that I can only update the fields in a Main
Tester document ONCE per time I open that file. If I try
to update them again, it says "Error - cannot find
file." I then save, close, re-open the file and do
Update and my info is back.

Is there any way to either have word automatically update
these files or avoid this Error?

Sincerely,
Kris
 
C

Cindy M -WordMVP-

Hi Kris,
My problem is that I can only update the fields in a Main
Tester document ONCE per time I open that file. If I try
to update them again, it says "Error - cannot find
file." I then save, close, re-open the file and do
Update and my info is back.
This sounds almost as if the fields have relative, rather
than full paths to the inserted files and that Word does not
consider this folder location as "current", so is not
recognizing the relative path.

Do you specifically need relative paths for the links?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
K

Kris

Hi Cindy,

I actually have all the files in the same directory.
I heard that trying to have them in different folder and
then using relative paths would be problematic. I don't
have them setup to use absolute paths either such as
"c:\My documents\..." since I have been editing these on
my local hard drive then copying the files to our network
location so others can view them.
 
C

Cindy M -WordMVP-

Hi Kris,

OK, I *think* I follow what you're saying, here. The
problem is that Word doesn't necessarily consider where the
"container" document is stored when it tries to resolve the
path in a link. It often takes the location of the last
document opened, or something else, and calculates from
that point.

One way around this is to store the full path in a custom
document property (File/Properties) and use a DocProperty
field inside the IncludePicture field to provide the
information. This means that, when the path changes, a
change need be made in only one location, instead of in all
the links in the document.

An alternate method is to use Find/Replace to change the
path in all the links.

To make this more user-friendly, you can use an AutoOpen
macro to check the path of the current document, then
change the path "source".
I actually have all the files in the same directory.
I heard that trying to have them in different folder and
then using relative paths would be problematic. I don't
have them setup to use absolute paths either such as
"c:\My documents\..." since I have been editing these on
my local hard drive then copying the files to our network
location so others can view them.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
K

Kris

Hi again,

You're right exactly. I believe it trys to get the files
but looks in the wrong directory since I don't use
absolute
paths.

I tested absolute paths and that works fine, but if I
move the file (as I will whenever I post it to our
network)
then the path would have to be change on each. I can use
the
Find/ Replace, however I'm not sure how to have the auto-
open macro findout the current path? Would you be able
to
offer some assistance on this?

Thank you,
Kris
 
C

Cindy M -WordMVP-

Hi Kris,
I'm not sure how to have the auto-
open macro findout the current path?
If you want the path to the current document, then the code
would be:

thePath = ActiveDocument.Path

Note that you probably need to add a backslash to this
before you can append a file name (ActiveDocument.Path &
"\" & theFileName)

This is one reason why I prefer to store the path in a
custom document property: I don't have to worry what the
previous path name was:

ActiveDocument.CustomDocumentProperties("linksPath") =
ActiveDocument.Path

Then, in the IncludePicture or IncludeText field it looks
like this:
{ IncludePicture "{ DocProperty linksPath
}\filename.gif" }

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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