Barb,
Most document properties are already created just empty.
Open a File
Click File>Properties>Summary
Do you see data in Title, or Author, or Company? These are built in
DocProperties with data provided by the filename and your User
settings.
To display this data in the document, type Author, select it, press
CTRL+F9, select it and press ALT+F9.
For the sample I gave you yesterday I just used the Manager field to
store a manually entered date and time.
You will probably want to create a your own Custom docProperty to hold
this data. Use the custom tab and create away. In the sample below, I
used "Recorded Date" a predefined custom document propert.
To display custom properties you need { DocProperty "Recorded Date" }
or both the field name and property name in the field codes.
I assume that each document will have its own significant change
variable so yes you will need the variable in each document.
You don't necessarily have to put the macro in every document. You can
put it in a template if you want to, however it will fire on closing
any document that you create with that template. You wouldn't want it
in your normal.dot.
If you have the macro named and set up correctly it will fire on the
close event. Some links to following lower in this string (or thread,
whatever they are called).
The error was due to line breaking in this message window. I have
tried to shorten the lines to prevent, but I can't guarantee it will
come across clean. Lets hope so.
Yes I can tell, but I have a lot to learn myself.
Private Sub Document_Close()
Dim lastMod
Dim oFld As Field
lastMod = ActiveDocument.CustomDocumentProperties("Recorded
Date").Value
If MsgBox("The document modification date is " & lastMod & "." _
& " Do you want to change the document modification" _
& " date?", vbYesNo) = vbYes Then
WordBasic.FileProperties
For Each oFld In ActiveDocument.Fields
If InStr(oFld.Code.Text, "Recorded Date") Then
oFld.Update
Exit For
End If
Next
'ActiveDocument.Save
End If
End Sub
http://word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm
http://www.gmayor.com/installing_macro.htm
http://gregmaxey.mvps.org/word_tips.htm