BuiltIn Doc Property - wdPropertyTimeLastSaved - does not update

M

Mad Dog

Hi All

I want to use code prove that a document has been saved, or otherwise.
Before saving the document (using ActiveDocument.Save) I use a message box to
display the date/time the document was last saved i.e. the value of
wdPropertyTimeLastSaved). I then save and display another message box with
the new value for wdPropertyTimeLastSaved. The problem is that it the value
doesn't appear to update the seconds field so, if I save the document at an
interval of less than one minute, the two values are the same. Is there a
way around this?

Many thanks for any help in advance
Mad Dog
 
J

Jezebel

Are you sure the second save is actually doing something? Unless the
document's .Saved property is FALSE, the Save method does nothing (so the
LastSavedTime won't change).
 
M

Mad Dog

Hi Jezebel

The document has been modified and does save. When I re-open it the
modified text is there.

Mad Dog
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWFkIERvZw==?=,
I want to use code prove that a document has been saved, or otherwise.
Before saving the document (using ActiveDocument.Save) I use a message box to
display the date/time the document was last saved i.e. the value of
wdPropertyTimeLastSaved). I then save and display another message box with
the new value for wdPropertyTimeLastSaved. The problem is that it the value
doesn't appear to update the seconds field so, if I save the document at an
interval of less than one minute, the two values are the same. Is there a
way around this?
These built-in properties about when something was saved or created or whatever
are really only "for convenience". They really can't be relied on for anything
important.

My suggestion would be to have a macro run when the user saves that puts the
current time information into a document VARIABLE. Then you can retrieve that
any time you like.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top