View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Anderflash Anderflash is offline
external usenet poster
 
Posts: 26
Default IncludeText with relative path

I have this text from a site:
-------------------------------------------------------------------------------------
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 absolute filepaths, but create a custom document property
to store the base filepath (FilePropertiesCustom). Then use a DocProperty
field to carry the path info into the IncludeText fields. You can easily
change the custom document property in FileProperties. The nested fields
might look like this:

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

Workaround 2: use relative filepaths, but go into FileProperties 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. Help says this works, but some people have had problems with it.
------------------------------------------------------------------------------------

Can someone explain me or give me an example about these Workarounds?
I think the Workaround 1 isn't what I want, because I don't want the user
changes the custom property each time he moves the document.
And about the Workaround 2, how do I use the hyperlink base property to make
the path relative? If the user moves the document, does this procedure work?