Reply
 
Thread Tools Display Modes
  #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?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IncludeText with relative path

It is only my personal opinion, but I see no evidence that the "hyperlink
base" approach works at all, and suspect it is nothing more than an
untested theory. Perhaps if you get the hyperlink base syntax exactly right
it can be made to work, but perhaps it is also significant that the article
you quote does not provide concrete examples.

The "Properties" approach is AFAIK workable as long as you do not have
problems resulting from the setting of Tools|Options|General|Web
options|Files|"Update links on save"

There is another approach you can consider: suppose the file you want to
include is called "abc.ext" and is in the same folder as the including
file - try:

{ INCLUDETEXT "{ filename /p }\\..\\abc.ext" }

and take it from there. You should find that other "relative naming" also
works, but it may depend on having a certain version of Word etc. - in other
words, I wouldn't want to rely on this sort of stuff working.

Peter Jamieson

"Anderflash" wrote in message
...
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?


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative path links DaveO Microsoft Word Help 0 July 20th 05 06:52 PM
Relative Path in INCLUDETEXT Donna Microsoft Word Help 1 June 12th 05 02:44 AM
Relative File Path Jim Microsoft Word Help 1 May 23rd 05 12:29 PM
relative path within includetext George Lagger Mailmerge 2 January 27th 05 03:15 PM
Relative path in LINK field ? Timvdv Microsoft Word Help 2 January 17th 05 11:41 AM


All times are GMT +1. The time now is 07:23 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"