Home |
Search |
Today's Posts |
#1
|
|||
|
|||
relative path within includetext
i need to insert text from one file to another with an "includetext" field,
but doing so i have to specify the full path to the file. When both files migrate to some other folders, the path obviously changes. Can i use a 'relative' form of the path (smth like ActiveDocument.Path in VB) in the "includetext" field? |
#2
|
|||
|
|||
George,
(I have the same problem, and I have found this partial solution, which I admit is not optimal) Word supports relative paths in {includetext} in a funny way - they are relative to the current working directory of MS Word. One way of setting the working directory is to do a File/Open and browse to the directory where your .doc lives, then hit "Cancel". An easier way is to open your .doc using File/Open in the first place. Then, you can write {includetext "foo.txt"} and it will pick up foo.txt from the same directory as your .doc. Or even {includetext "..\\foo.txt"}. Careful though, any use of the File/Open dialog will cause the working directory to get reset. Before updating links with F9, be sure to use File/Open to reset the working dir. Not great, but it worked for me. |
#3
|
|||
|
|||
Ed, thank you for your attention to the problem
I also found a solution implying a little bit of VB programming: *** Private Sub Document_Open() ThisDocument.CustomDocumentProperties("Path") = ThisDocument.Path End Sub *** On opening the main document this macro creates a property "Path" (and fills it with the path to your main doc), which may be used in the includetext field, e.g. { INCLUDETEXT "{DOCPROPERTY Path}\\FileToInclude.doc" } where "FileToInclude.doc" is the Filename (without path) of your file with the text to include. It works (at least in Word 2003), although the path contains single backslashes instead of doubles. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linked Objects and path names | Microsoft Word Help | |||
Relative path in LINK field ? | Microsoft Word Help | |||
hyperlink changes address from absolute path to relative | Microsoft Word Help | |||
how to make a relative path in a hyperlink in a word-html file? | Microsoft Word Help | |||
Add support for relative path names in master documents | Microsoft Word Help |