Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Owner2229
in reply to: francesco.dinh

Just use this:

 

Sub Main()
	Dim Thread1 As New System.Threading.Thread(AddressOf AutoSave)
	Thread1.Start()
End Sub

Sub AutoSave()
	Dim AST As Integer = 0
	While True
		If AST >= 15 Then '15 minutes
			AST = 0
			Dim SF As DialogResult = MessageBox.Show("Do you want to save?", "Autosave", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
			If SF = vbYes Then
				ThisDoc.Save()
			End If
		Else
			AST += 1
		End If
		System.Threading.Thread.Sleep(60000) '1 minute = 60000 ms
	End While
End Sub

 

If you want it to be 100 actions instead of 15 just do the maths. It'll be 100 and  9000

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods