07-28-2017
02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-28-2017
02:21 AM
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
- - - - - - - - - - - - - - -
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