Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FileName Field (Word 2002)

    On some templates I use the Field <FileName> with a </p> as a reference. In the Print Options I have <Update Fields> checked.

    Is it possible to have the <FileName> field update when the template is saved? At present I have to use F9 to get the correct reference to show prior to printing the document.

    Thanks
    Tony

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

    Re: FileName Field (Word 2002)

    That wouldn't help. since the filename of the template won't be that of the document.

  3. #3
    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 Field (Word 2002)

    The quick fix is to preview your document, but that's not any faster than updating fields manually...

    You can "replace" the FileSaveAs procedure in Word with your own code. This could first display the dialog to the user and, if the user saves the document, update all the fields in the document. (It has to be done after saving, of course, because the field needs to pick up the new name.) The complexity of this project depends on whether you just need a quick fix for yourself or you plan to distribute this code to others who might do unpredictable things. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  4. #4
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FileName Field (Word 2002)

    Thanks for the suggestion.
    I should have said the <FileName> field does not update when I do a Print Preview.

    There is a “resistance” from other users of the template to click on the field and do a F9. If the field updated after a print preview that would be fine – so far it doesn’t!
    Tony

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: FileName Field (Word 2002)

    Hi Tony,

    If the field is in the document header or footer, it *should* update if you do a Print Preview. Of course, if the document hasn't been saved, it still won't have a useful name ... and it won't have a path at all.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FileName Field (Word 2002)

    Just checked, if the <FileName> field is in the Header or Footer of the template and a Save is done then this new filename is shown when a Print Preview is chosen, however the update doesn’t happen if the <FileName> field is in the main text of the document.

    Took this a little further – having seen the updated <FileName> field as a result of doing a Print Preview I then closed the document without actually printing. Opened the document again and ALL the <FileName> fields (1 each in header and footer and 1 in body text) had reverted to the file name provided prior to when I had first saved the document! I then did a Print Preview and as before the <FileName> fields updated in the Header and Footer, but not in the main text.

    It was only when an actual Print was done did all the <FileName> fields show the correct information and retain that information after closing and then opening the document again.

    Is there a logic to this or is it just the way Word works?

    Looks like I shall have to overcome the resistance of others to using F9 on the field!

    Thanks for following up on this minor problem.

    Regards

    Tony

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

    Re: FileName Field (Word 2002)


  8. #8
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FileName Field (Word 2002)

    Thanks

    I understand what is happening now.

    Tony

Posting Permissions

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