Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filename and path (Word 2000)

    I am devastated! I have just discovered that when ever I enter the filename and path in a document, it doesn't automatically update when you move the document elsewhere or when you rename it.

    Does anyone have any idea how I could automate the update field process or some other fantastic way I could have some sort of auto-updating on closing or opening the file.

    Thanks in advance,

    Emily

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filename and path (Word 2000)

    See WD2000: How to Automatically Update Fields.

    BTW, a FILENAME field in the document header or footer will automatically be updated when you print or print preview the document.

  3. #3
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    Thank you very much Hans.

  4. #4
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    Hello again,

    I now have problems. Firstly, when I print or go into print preview this doesn't seem to update the 'filename and path' field. Do I need to have some setting switched on?

    Also, I followed the instructions in 'How to automatically update fields' and the correspondence file I opened acted like the template it was based on. It went through asking me for all the field information (the way I have set up the template to do). Why do you think this is? It has just occurred to me that I should maybe have closed Word first, before going into the correspondence doc. Would this have helped?

    Emily

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filename and path (Word 2000)

    Hi Emily,

    You can check the Type property of a field to test if it is a Filename field. Replace aField.Update by

    If aField.Type = wdFieldFileName Then
    aField.Update
    End If

  6. #6
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    (Edited by HansV - inserted <!t>[pre]<!/t> and <!t>[/pre]<!/t> tags to preserve indentation, see <!help=19>Help 19<!/help>)

    What I have realised is that I would like to change the VB code to update just the 'Filename and path' field and not all fields.
    Here is the code:
    <pre>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
    </pre>

    How can I alter it?

    Cheers,

    Emily.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Filename and path (Word 2000)

    There is a checkbox under Tools>Options...>Print to Update fields at print time. Normally, header and footer fields update automatically (unless locked), and this checkbox should cover all the other fields in the document. That's the official story; your mileage may vary.

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    Hi Jefferson:
    Funny. I tried this before in Word 2000. I found that when the filepath field was in the main document, it wasn't updated when you go to Print Preview, even if Tools/Options/Print/Update fields is checked. However, it will be updated if I print the document (provided the option is checked).

    I think it's a poor design, but that's how it seems to work per <!mskb=212054>Microsoft Knowledge Base Article 212054<!/mskb>.

  9. #9
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    Hi Hans,
    D
    o I replace the For... line with the If... line
    or just put the if line after it and before afield.Update

    Cheers,

    Emily

  10. #10
    Star Lounger
    Join Date
    Oct 2003
    Location
    Kent, UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filename and path (Word 2000)

    Hans,
    Ignore my last post,
    I just re-read yours.
    Sorry, and thanks again.
    Emily

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •