WinWord: PAGEREF Field Does Not Work with INCLUDE Field

ID: Q84714

The information in this article applies to:

SUMMARY

In Microsoft Word for Windows, if you use a PAGEREF field inside an INCLUDE field, the PAGEREF field will not reference the correct page number.

MORE INFORMATION

The PAGEREF field inserts the page number of a specific bookmark as a cross-reference. If you use this field in a document that is included as a linked document in a second document, the second document will not display the correct result of the included PAGEREF field unless the PAGEREF fields are updated individually before the entire INCLUDE field is updated. This problem occurs because of the order in which nested fields are updated. Fields are updated from the innermost field to the outermost one. When the INCLUDE field is updated, the nested PAGEREF fields update first and therefore without a proper reference. This results in incorrect page numbers.

WORKAROUND

To avoid this problem, when you insert documents into a second document using PAGEREF fields, do NOT use the Link option. This eliminates the active link between documents and causes Word to correctly display all PAGEREF field results.

In certain situations, you may want to prevent the original values of the PAGEREF fields in the source document from updating when you insert the source document into the second document. In these situations, you can lock the INCLUDE field with the \! switch to keep the PAGEREF fields from updating in the second document.

For more information on using the lock field switch:

Steps to Reproduce Problem

1. In a new document, type "1st bookmark" (without the quotation

   marks), and press ENTER.

2. Select the new text. From the Insert menu, choose Bookmark, and
   type the bookmark name "b1" (without the quotation marks).

3. On a new line, type "see page {pageref b1}" (without the quotation
   marks). Press ENTER. Note: The braces are created by pressing CTRL+F9.

4. From the Insert menu, choose Break.

5. Select Page Break, then choose the OK button.

6. Type "2nd bookmark" (without the quotation marks), and press ENTER.

7. Select the new text. From the Insert menu, choose Bookmark. Type

   the bookmark name "b2" (without the quotation marks).

8. On a new line, type "see page {pageref b2}" (without the quotation
   marks), and press ENTER.

9. Select the entire document, and press F9 to update it. From the
   View menu, clear the Field Codes command.

The document should display as follows:

   1st bookmark
   see page 1

   ... (page break)

   2nd bookmark
   see page 2

If this document is included in a second document using an INCLUDE field, the PAGEREF fields above will incorrectly display the result of the last page in the document rather than the page the bookmarks are actually located on.

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

"Microsoft Word for Windows User's Guide," version 2.0, pages 746, 749

KBCategory: KBSubcategory: Additional query words: 1.0 1.10 1.10a 2.0 2.0a 2.0a-CD 2.0b word6 2.0c 6.0 6.0a 6.0c winword winword2

Version           : 1.x 2.x 6.0 6.0a 6.0c
Platform          : WINDOWS

Last Reviewed: February 6, 1998