Hack 78 Cross-Reference Among Documents![]() ![]() cross-references among different Word documents.When you create a cross-reference in Word, no option exists for referencing content in another document. But sometimes you need to split your work into multiple files, like the chapters in a book. (Word once actually encouraged this practice; the Word 2.0 manual says, "If your document is longer than 20 pages, consider creating several smaller documents.") If you use fields and bookmarks, you can create your own dynamic cross-references among separate Word documents.A cross-reference has two parts: the reference and the target. A target is sort of like an Internet URL, and a reference is like a link to that URL. Each target can have multiple references pointing to it, but each reference can point to only one target. Just like URLs, each target must have a unique identifier. 8.10.1 Understanding Word's Native Cross-ReferencingWhen you make a cross-reference in Word (Insert Insert it displays the dialog shown in Figure 8-17. You can choose between several different reference types, but notice that there's no option for text in another document. Figure 8-17. Word's Cross-reference dialog![]() inserts a bookmark around the target text. Word hides the bookmark it creates to mark your reference target, but you can see its name if you look in the Insert "Hidden bookmarks" box, as shown in Figure 8-18. If your hidden bookmarks don't show up in the dialog, uncheck and then recheck the box. Figure 8-18. You can view your cross-reference bookmarks in the Bookmark dialog![]() "_Ref46516798," to make the bookmark unique. The leading underscore denotes a hidden bookmark.While the bookmark's name may be unique, it's not very useful. If you need to determine which bookmark belongs to which reference target, the list shown in Figure 8-19 offers little comfort. Figure 8-19. Word's decidedly unhelpful bookmark-naming convention for cross-references![]() troubleshooting cross-references, because bookmarks behave very, very strangely when you edit the text they enclose. For example, if you add text to the end of a heading that you cross-referenced and update the reference, the new text isn't included in the reference. Figure 8-20 shows this phenomenon using a manually created bookmark (so the ends are visible), but the same thing happens with Word's cross-reference bookmarks. Figure 8-20. When you add text at the end of a bookmarked paragraph, the bookmark doesn't expand![]() must put the new text before the last character and then delete the last character. But wait, it gets worse. Inserting text at the beginning of the paragraph works just fine, but if you hit Enter with your cursor at the beginning of the paragraph, the bookmark's beginning gets left behind, as shown in Figure 8-21. Figure 8-21. A wayward bookmark![]() cross-references work, you're ready to create your own cross-references between two different documents. 8.10.2 Create Cross-References with INCLUDETEXT FieldsTo reference text in a different document, you can use the same general method Word does: mark the target with a unique bookmark and then reference the contents of the bookmark with a field.
"Chapter One," "Chapter Two," and so on. Chapter Two contains a section you want to reference in Chapter Three.First, open the document containing the target (Chapter Two in this example) and go to the heading you want to reference. Select the entire heading, except for the trailing paragraph mark. Select Insert a descriptive name, as shown in Figure 8-22. Word will warn you if you try to use any illegal characters, such as a space, in the name. Figure 8-22. Choose a descriptive and unique name for your bookmark![]() you've chosen to show bookmarks (select Tools bookmark's ends will appear as grey or black brackets, depending on your version of Word. Don't worry; the bookmarks will not appear when you print the document.
reference to appear. Press Ctrl-F9 (or select Insert to insert a blank set of field braces and type the following between them: INCLUDETEXT "Chapter Two.doc"Note that you enclose the filename in quotes, but not the bookmark name.Select the field and press F9. The reference will now display the bookmarked text. With "Field shading" set to Always (select Tools your cross-references, as shown in Figure 8-23. Figure 8-23. A cross-reference to an external Word document![]()
just the bookmark's contents. The bookmark itself now appears in the reference document's list of bookmarks.
and [Hack #44] . |