Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How to *stop* auto-update of fields on open? (WinNT/Word97)

    Is there any way to *prevent* the automatic updating of fields on opening a document, other than switching off the auto update on open option in Tools, Options?

    I have a couple of templates that pick up values from Excel spreadsheets, which work fine, but the thing is that when the template runs, the first thing it does is update the fields in the template, so when the user goes to save their document Word asks if they want to save the changes to the template, too.

    They can't do so (they're all read only) but it's a nuisance and causes confusion at all levels!

    I don't want to switch off the Tools Option to auto update because this will stop any others updating and this is used quite extensively elsewhere - it's only when it's in a template it becomes a nuisance!

    Many thanks in advance!
    Beryl M


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

    Re: How to *stop* auto-update of fields on open? (WinNT/Word97)

    Set the Excel links to manual updating instead of automatic. You can do this in the Edit | Links dialog, or by removing the /a switch from the field codes.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to *stop* auto-update of fields on open? (WinNT/Word97)

    Thanks, Hans.
    Beryl M


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

    Re: How to *stop* auto-update of fields on open? (WinNT/Word97)

    Hi Beryl,

    Another way might be to use code like the following in your template:

    Sub AutoOpen()
    ActiveDocument.Saved = True
    End Sub

    This avoids fiddling with Excel's settings or the field codes. The former could have adverse effects on other workbooks the users are working on, and the latter would cause documents based on the template not to auto-update either.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to *stop* auto-update of fields on open? (WinNT/Word97)

    Hiya, yes, in fact I found that even with the links set to manual and the a taken out it still updated - I tracked it down to an errant piece of code in our master code library, which made life very difficult since I can't just change that!

    In fact your suggestion was (almost) exactly what I used in the end - the template wasn't the activedocument by the time it needed to be marked as saved, so I ended up with:

    ActiveDocument.AttachedTemplate.Saved = True

    Then it behaved!

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Beryl M


Posting Permissions

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