Microsoft KB Archive/909034

= The FileName field in a header or in a footer is not automatically updated when you use the &quot;Save As&quot; command in Word 2004 for Mac =

Article ID: 909034

Article Last Modified on 10/28/2005

-

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:  Open the Word 2004 for Mac document that contains the field that you want to update. On the Tools menu, point to Macros, and then click Visual Basic Editor. On the Insert menu, click Module.  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  On the File menu, click Save . Note that  is the name of the document that contains the field that you want to update. On the Word menu, click Close and Return to Microsoft Word.</li> In Word 2004 for Mac, click Close on the File menu.</li> Reopen your Word 2004 for Mac document.</li> Click Enable Macros.</li></ol>

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.

<div class="moreinformation_section">

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: <ol> Start Word 2004 for Mac. Then, create a new document that includes a header or a footer that contains the fields that you want.</li> On the Tools menu, point to Macros, and then click Visual Basic Editor.</li> On the Insert menu, click Module.</li>  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 </li> On the File menu, click Save . Note that  is the name of the document that contains the field that you want to update.</li> On the Word menu, click Close and Return to Microsoft Word.</li> On the File menu, click Save.</li> Type the file name that you want. Then, click the location where you want to save the file.</li> In the Format box, click Document Template, and then click Save.</li> In Word 2004 for Mac, click Close on the File menu.</li> On the File menu, click Project Gallery.</li> Click My Templates, click the file that you saved as a template, and then click Open.</li></ol>

The field should now be automatically updated in your Word 2004 for Mac document.

Additional query words: wd2004

Keywords: kbtshoot kbprb KB909034

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.