auto update of time when revising a document

J

James

HI

Just wondered if there is a way of automatically updating the time stamp and
version number in a heading / footer whenever a document is edited? Eg: in
my heading I have:

[doc name] [my name] [date last revised] [version number]

Cheers!

James
 
G

Graham Mayor

You could either create numbered versions e.g.
http://www.gmayor.com/save_numbered_versions.htm
or you could use docvariable fields to store the modification date and
version number. Funnily enough I have just updated my web page on that topic
to demonstrate how that could be done (for the date/time at least). Adding a
version number is simply a matter of incrementing a value stored in a doc
variable each time the document is saved. e.g.

On Error Resume Next
If ActiveDocument.Variables("varVersionNumber").Value = "" Then
ActiveDocument.Variables("varVersionNumber").Value = "1"
Else
ActiveDocument.Variables("varVersionNumber").Value = _
ActiveDocument.Variables("varVersionNumber").Value + 1
End If

Add the code to the two save macros shown at the end of
http://www.gmayor.com/stop_automatic_date_update.htm
and add a docvariable field {DocVariable varVersionNumber} to the document.

The macros on my web page do not update the headers.
You would need to include the example code from
http://www.gmayor.com/installing_macro.htm to update the header/footer
fields.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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