View Single Post
 
Old 09-12-2024, 04:04 AM
Octochimp Octochimp is offline Windows 11 Office 2021
Novice
 
Join Date: Sep 2024
Posts: 1
Octochimp is on a distinguished road
Default

this took way too long to figure out, but it is remarkably simple in hindsight, so here it is

in VBA in the main ThisDocument page put :

Option Explicit
Private Sub Document_Open()
CheckTime
End Sub

then, add a module, containing the following :

Option Explicit
Dim PreviousContent As String
Sub CheckTime()
PreviousContent = ActiveDocument.Content
Application.OnTime When:=Now + TimeValue("00:10:00"), _
Name:="DoCompare"
End Sub
Sub DoCompare()
If ActiveDocument.Content = PreviousContent Then
'if no changes after 10 minutes, save then close the document
ActiveDocument.Save
ActiveDocument.Close
Else
CheckTime
End If
End Sub
Reply With Quote