The FileName field in a header or in a footer is not automatically updated when you use the "Save As" command in Word 2004 for Mac (909034)



The information in this article applies to:

  • Microsoft Word 2004 for Mac

SYMPTOMS

You insert a FileName field into a header or into a footer in a Microsoft Word 2004 for Mac document. However, the FileName field is not automatically updated as expected when you use the Save As command to save the file as a file that has a different name.

CAUSE

This issue occurs because of a design change that enables Word 2004 for Mac documents that contain a FileName field to open faster.

WORKAROUND

To work around this issue, use one of the following methods.

Method 1: Switch views in the document

To switch views in the document, follow these steps:
  1. In the Word 2004 for Mac document, click Normal on the View menu.
  2. On the View menu, click Page Layout.

Method 2: Use the Print Preview command

To use the Print Preview command to work around this issue, follow these steps:
  1. In the Word 2004 for Mac document, click Print Preview on the File menu.
  2. Click Close to close the print preview.

Method 3: Print the document

To work around this issue, print the Word 2004 for Mac document.

Method 4: Create an AutoOpen macro to automatically update the field

To create a AutoOpen macro to automatically update the field, follow these steps:
  1. Open the Word 2004 for Mac document that contains the field that you want to update.
  2. On the Tools menu, point to Macros, and then click Visual Basic Editor.
  3. On the Insert menu, click Module.
  4. Type the following macro code in the Visual Basic Editor code sheet.
    Sub AutoOpen() 
     Dim aStory As Range 
     Dim aField As Field 
     For Each aStory In ActiveDocument.StoryRanges 
     For Each aField In aStory.Fields 
     aField.Update 
     Next aField 
     Next aStory 
     End Sub
  5. On the File menu, click Save document. Note that document is the name of the document that contains the field that you want to update.
  6. On the Word menu, click Close and Return to Microsoft Word.
  7. In Word 2004 for Mac, click Close on the File menu.
  8. Reopen your Word 2004 for Mac document.
  9. Click Enable Macros.
The field should now be automatically updated in your Word 2004 for Mac document.

Note If you create an AutoOpen macro in a Word 2004 for Mac Document, the file name in the header or in the footer is automatically updated. If you add the /p field-specific switch to the FileName field, the path and the file name are automatically updated if you move, copy, or rename the file.
You can create an AutoNew macro in a template to automatically update the fields in the header or in the footer when you open a new document. To do this, follow these steps:
  1. Start Word 2004 for Mac. Then, create a new document that includes a header or a footer that contains the fields that you want.
  2. On the Tools menu, point to Macros, and then click Visual Basic Editor.
  3. On the Insert menu, click Module.
  4. Type the following macro code in the Visual Basic Editor code sheet.
    Sub AutoOpen() 
     Dim aStory As Range 
     Dim aField As Field 
     For Each aStory In ActiveDocument.StoryRanges 
     For Each aField In aStory.Fields 
     aField.Update 
     Next aField 
     Next aStory 
     End Sub
  5. On the File menu, click Save document. Note that document is the name of the document that contains the field that you want to update.
  6. On the Word menu, click Close and Return to Microsoft Word.
  7. On the File menu, click Save.
  8. Type the file name that you want. Then, click the location where you want to save the file.
  9. In the Format box, click Document Template, and then click Save.
  10. In Word 2004 for Mac, click Close on the File menu.
  11. On the File menu, click Project Gallery.
  12. Click My Templates, click the file that you saved as a template, and then click Open.
The field should now be automatically updated in your Word 2004 for Mac document.

Modification Type:MajorLast Reviewed:10/28/2005
Keywords:kbtshoot kbprb KB909034 kbAudEndUser