![]() |
#1
|
|||
|
|||
![]()
Hey Guys,
Got this macro somewhere and it works good in a docm. but I want it to work in a dotm. Tried everything I know, not working. here's the code for the macro- Code:
Option Explicit Private Const mlngTimeout As Long = 5*60 Public gsngStartTime As Single Private msngElapsed As Single Public Sub AutoSave() msngElapsed = Timer - gsngStartTime If ThisDocument.Saved = True Then gsngStartTime = Timer ElseIf msngElapsed >= mlngTimeout Then ThisDocument.Save MsgBox "Remember to save your work regularly." gsngStartTime = Timer End If Application.OnTime When:=Now + TimeValue("00:00:10"), Name:="Project.Module1.AutoSave" End Sub Code:
Private Sub Document_Open() gsngStartTime = Timer Application.OnTime When:=Now + TimeValue("00:00:10"), Name:="Project.Module1.AutoSave" End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
hysterical.useless | Word VBA | 12 | 02-05-2018 02:17 PM |
![]() |
brent chadwick | Word VBA | 10 | 10-25-2017 08:26 AM |
![]() |
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
![]() |
bitraker | Word | 1 | 12-28-2015 09:40 AM |
![]() |
shewoman | Word | 4 | 10-28-2015 03:51 AM |