Thread: Time stamp
View Single Post
  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Time stamp

You could use a savedate field eg { SaveDate \@ "HH:mm" } which will record
the last time the document was saved when the document is next opened, but
the field will not update automatically as you make saves to the document
during the course of working - it will however fulfil the basic criterion of
recording the time.

Or you could intercept the FileSave command to add a document variable to
the document and update it each time the document is saved and if you have a
docvariable field in the document - here { DocVariable varSaved } - that
field will display the time the document was saved and update each time you
save.

Sub FileSave()
Dim oVars As Variables
Dim sDate As String
Dim oStory As Range
Dim oField As Field
Set oVars = .Variables
With ActiveDocument
oVars("varSaved").Value = "Last saved at " _
& Format(Time, "hh:mm")
For Each oStory In .StoryRanges
For Each oField In oStory.Fields
If oField.Type = wdFieldDocVariable Then oField.Update
Next oField
Next oStory
.Save
ActiveWindow.Caption = ActiveDocument.FullName
End With
End Sub
http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




"JB" wrote in message
...
When I close a document I would like to have the time it was saved at the
top of the document. How is that done, please?

JB