Hi Mike,
have a look at this:
Sub Test443()
' this is the start macro
' the interval is 15 seconds for testing purposes
ActiveDocument.Save
Application.OnTime _
When:=Now + TimeValue("00:00:15"), _
Name:="Test444"
End Sub
Sub Test444()
If ActiveDocument.Saved = True Then
' if saved = true then nothing was changed
' or almost nothing to be accurate
' as some actions like changing a docproperty
' are not regarded as document change
MsgBox "Time to go" ' for testing only
ActiveDocument.Close
Else
Test443
End If
End Sub
Helmut, this line of code is risky
Now + TimeValue("00:00:15"
because it makes assumptions about the machine's regional settings
(Reasonable assumptions, to be sure, but assumptions none the less.
Better to use DateAdd()
Yes, it would actually work in most of the regions I've dealt with too. The
point is, it's not *guaranteed* to work. There are regional settings you
*could* choose that would cause it to fail.
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.