View Single Post
 
Old 09-05-2014, 05:19 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by mmmconsulting View Post
Also, I created my "source" file (the one with all the INCLUDETEXT commands) in the same directory as the files I'm including. That way I can make the INCLUDETEXT a little shorter, using a relative path:

{ INCLUDETEXT "Introduction.docx" \* MERGEFORMAT }
{ INCLUDETEXT "RequestTimeOff.docx" \* MERGEFORMAT }
{ INCLUDETEXT "PayrollPolicies.docx" \* MERGEFORMAT }
Whilst that will work provided everything remains in the current folder, you're liable to find it'll break when the files are moved to a different folder, especially if different Word versions become involved. To make this workable across all folders & Word versions, using your first example:
1. insert /../ thus:
{ INCLUDETEXT "/../Introduction.docx" \* MERGEFORMAT }
2. Press Ctrl-F9 before the first /, to create a pair of field braces, thus:
{ INCLUDETEXT "{ }/../Introduction.docx" \* MERGEFORMAT }
3. Fill in between the field braces, thus:
{ INCLUDETEXT "{FILENAME /p}/../Introduction.docx" \* MERGEFORMAT }

The same approach can be used for HYPERLINK fields, RD fields and INCLUDEPICTURE fields, though you need to at least temporarily switch to the .doc format to be able to access INCLUDEPICTURE field codes.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote