Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update field when document saved (Word 2000)

    In the text of my documents, on the first page, I have text tjat contains a Document Properties field to show the Date/Time the document was last saved. This allows me to keep track of drafts, and whenever I email a draft to someone else, they always know what version/draft it is.

    I know how to make all fields update when a document is opened, as well as when a document is printed. But what I really want is a way to make this field automatically update at the relevant event: i.e., whenever the document is *saved,* so that the field always is current. Is there anyway to make an automacro that will be triggered whenever a document is saved, or better, modify the field properties so that the update happens even w/o writing a macro? (Automacros are a problem because our IT folks mess around with security settings on various people's machines so that automacros don't always run.)

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

    Re: Update field when document saved (Word 2000)

    I would think that it's useless to update a field containing the last saved date/time before closing a document - if a user closes the document and answers Yes to the prompt to save the document, the field is updated and *then* the document is saved, changing the last saved date/time...
    Updating the field when opening the document makes more sense to me - that way anyone who opens the document can see the "real" date/time it was last saved.

  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: Update field when document saved (Word 2000)

    In Word, you can replace the commands FileSave, FileSaveAs, and FileClose by creating macros with those same names. In fact, you might have to do this if your other options are limited. There are DocumentBeforeSave and DocumentBeforeClose event hooks that you could code, but I haven't used them myself.

    Thinking through HansV's comment, while saving then updating the field then saving again (to store the update) could be an endless loop, a few milliseconds probably don't matter to you. Do they? If not, the 3-step would be enough if you have to have it.

  4. #4
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update field when document saved (Word 2000)

    On reflection, I think you're right. But this creates a slightly different problem/question:

    If I put a DateLastSaved field in a header,* no problem, because fields in headers update automatically when you open a file. But if I want instead to put the field in, say, a text box on the first page of a doc., I have to write an AutoOpen macro that will update all fields when the doc is opened. That's OK, except that the security settings on the machines for almost everyone who will be using this document don't allow AutoOpen macros to run (at least I think that's why everyone gets an error message about macro settings when they try to open the doc w/the AutoOpen macro installed). If this is the problem, I'm not sure that the NetAdmins will be happy if I tell everyone to reduce their security level.

    I know that there's some way to attach a digital certificate to a macro so that it runs even when macro security set to high, but I don't fully understand how to do this, and I believe (from the little I *do* understand) that I'd have to get our NetAdmins to act as a certificating (certifying?) authority, which would require some work on their part, and they are disinclined actually to work if not compelled to do so.

    Is there a solution other than the AutoOpen macro? If not, is there a tutorial or idiot's-guide-to-macro-security someone can point me to?

    Thanks!

    *If it helps, the reason I'm interested in all of this is so users -- whether looking at a printed document or a document on screen -- can tell whether they're looking at the most recent version of a document, or an earlier version. (I don't let anyone actually use Word's versioning function because in my experience documents get flaky after a number of versions, and also because it creates a metadata problem.) In this regard, I suppose another possible solution would be a macro that automatically renamed a document, incrementing a version number, each time it was saved. E.g.,: DocName v1.doc would automatically become DocName v2.doc, then DocName v3.doc, etc. I haven't been able to figure out how to implement that solution, either, however.

Posting Permissions

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