B
Barb R.
I want a macro that will run if any changes have been made to the document
and the document is either saved or closed. The following seems to run only
on close, but not on save. The macro is stored within the document as
opposed to in a template. Is there something I need to change?
Sub AutoClose()
'
' AutoClose Macro
' Macro created 3/29/2005 by Barb Reinhardt
'
Dim lastMod
lastMod = ActiveDocument.CustomDocumentProperties("ModificationDate").Value
If ActiveDocument.Saved = False Then
If MsgBox("The document modification date is " & lastMod & _
". Do you want to change" & " the document modification date to
today's date?", vbYesNo) = vbYes Then
ActiveDocument.CustomDocumentProperties("ModificationDate").Value = Date
Selection.WholeStory
Selection.Fields.Update
ActiveDocument.Save
End If
End If
End Sub
Thanks for your continued support (reminds me of the old Bartles and Jaymes
ads)
Barb Reinhardt
and the document is either saved or closed. The following seems to run only
on close, but not on save. The macro is stored within the document as
opposed to in a template. Is there something I need to change?
Sub AutoClose()
'
' AutoClose Macro
' Macro created 3/29/2005 by Barb Reinhardt
'
Dim lastMod
lastMod = ActiveDocument.CustomDocumentProperties("ModificationDate").Value
If ActiveDocument.Saved = False Then
If MsgBox("The document modification date is " & lastMod & _
". Do you want to change" & " the document modification date to
today's date?", vbYesNo) = vbYes Then
ActiveDocument.CustomDocumentProperties("ModificationDate").Value = Date
Selection.WholeStory
Selection.Fields.Update
ActiveDocument.Save
End If
End If
End Sub
Thanks for your continued support (reminds me of the old Bartles and Jaymes
ads)
Barb Reinhardt