Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



Filename field does not update automatically

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 06-05-2009
Member
 
Join Date: Feb 2009
Posts: 54
Filename field does not update automatically

hello friends,

When I tried to open a document in Microsoft Word 2003 , the FILENAME field (and path if applicable) does not update to the name and the location of the file that I just opened. How can I update the filename field in Word ?
Can anyone help.....
Reply With Quote
  #2  
Old 06-05-2009
Eric B's Avatar
Member
 
Join Date: Apr 2008
Posts: 4,645
Re: Filename field does not update automatically

To automatically update the field that is contained in your Word document, create an AutoOpen macro. To do this, follow these steps:
  1. Start Word and open the document that contains the field that will not update automatically.

  2. In Microsoft Office Word 2003 or in Word 2002, on the Tools menu, point to Macro, and then click Macros.
    In Microsoft Office Word 2007, click the Developer tab, and then click Macros in the Code group.

  3. In the Macros dialog box, follow these steps:
    • In the Macro name box, type AutoOpen.
    • Change the Macros in box to your document file name.
    • Click Create.

  4. In the code sheet of the Microsoft Visual Basic editor, you should now see the beginnings of your AutoOpen macro. You should see the following:

    Code:
    Sub AutoOpen()
    '
    ' AutoOpen Macro
    ' Macro created date by username
    '
    
    End Sub
  5. Type, or copy and paste, the following macro code into your AutoOpen macro:

    Code:
    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
  6. Your AutoOpen macro should now look like:

    Code:
    Sub AutoOpen()
    '
    ' AutoOpen Macro
    ' Macro created date by username
    '
    
       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
  7. On the File menu, click Save Filename.

  8. On the File menu, click Close and Return to Microsoft Word.

  9. In Word 2003 or Word 2002, on the Tools menu, point to Macro, and then click Security.
    In Word 2007, click the Developer tab, and then click Macro Security in the Code group.

  10. In Word 2003 or Word 2002, on the Security Level tab, change your security level to Medium, and then click OK.
    In Word 2007, under Macro Settings, click to select the Enable all macros option.

  11. Close your document.

  12. Reopen your Word document.

  13. Click Enable Macros in the Security Warning dialog box.

The field should now update automatically in your Word document.
Reply With Quote
  #3  
Old 06-05-2009
Glenny's Avatar
Member
 
Join Date: May 2008
Posts: 4,550
Re: Filename field does not update automatically

You can also update the filename field manually - just select the field that is contained in your Word document, and then press F9.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Filename field does not update automatically"
Thread Thread Starter Forum Replies Last Post
After software update Maps do not update automatically and album art loads slowly in Sony Xperia neo V Oriole Portable Devices 4 03-11-2011 10:43 PM
How can I update each field within a document at once? Rena Windows Software 5 25-04-2011 07:17 AM
Unable to update memo field Rixwel Software Development 3 24-09-2009 10:55 AM
Asking the impossible? Add %username% to domain computer's description field automatically? Lanwench [MVP - Exchange] Active Directory 6 23-09-2009 01:28 AM
AD Mass Field Update Jason Active Directory 6 06-03-2009 10:28 PM


All times are GMT +5.5. The time now is 09:48 PM.