Something along these lines:
' normal.dot
' -------------------------------------------------
Option Explicit
Dim ThisDoc As Document
' -------------------------------------------------
Sub autoopen()
Set ThisDoc = ActiveDocument
If ThisDoc.Name = "DocToWatch.doc" Then
StartIdle
End If
End Sub
' -------------------------------------------------
Sub StartIdle()
Application.OnTime _
When:=Now + TimeValue("00:00:05"), _
Name:="EndIdle"
End Sub
' -------------------------------------------------
Sub EndIdle()
MsgBox ThisDoc.Name & " = idle" 'for testing
With ThisDoc
If .Saved = True Then
.Close
Else
.Save
StartIdle
End If
End With
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"