![]() |
|
#1
|
|||
|
|||
![]()
Hey Guys,
Working on an auto save macro on Mac. This code works well so far except for two things: you need to save the first time manually with the Command +S, and when you do save manually later on it gives me the dialog box, which is annoying since if I am saving manually I don't want to see the dialog box. Suggestions? Code:
Public Sub FileSave() 'Auto Save macro ActiveDocument.SaveAs DoEvents Application.OnTime _ When:=Now + TimeValue("00:10:00"), _ Name:="FileSave" MsgBox "10 Minutes have elapsed since this document was saved. Do you want this " & ActiveDocument.Name & " document saved now?", 3 Application.StatusBar = "Auto Saved: " & ActiveDocument.Name End Sub |
#2
|
||||
|
||||
![]()
Well, if the document has never been saved, you'll need the dialogue box. To suppress it for subsequent saves, try something along the lines of:
Code:
Public Sub FileSave() 'Auto Save macro If ActiveDocument.Path = "" Then Application.Dialogs(wdDialogFileSaveAs).Show DoEvents Application.OnTime _ When:=Now + TimeValue("00:10:00"), _ Name:="FileSave" MsgBox "10 Minutes have elapsed since this document was saved. Do you want this " & ActiveDocument.Name & " document saved now?", 3 Application.StatusBar = "Auto Saved: " & ActiveDocument.Name End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thanks Paul, having the dialog box show up at the time interval is fine, I expect that. It is when I save in between times that I don't need to have the dialog box show up.
|
#4
|
||||
|
||||
![]()
What don't you want to show - a dialogue box or the message box?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
If I am saving the doc I don't want to see the dialog box with the options-to me it's redundant if I have already chosen to save it-
|
#6
|
||||
|
||||
![]()
In that case:
Code:
Public Sub FileSave() 'Auto Save macro If ActiveDocument.Path = "" Then Application.Dialogs(wdDialogFileSaveAs).Show Else ActiveDocument.Save End If DoEvents Application.OnTime When:=Now + TimeValue("00:10:00"), Name:="FileSave" End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
I don't think I am explaining what I want to happen correctly. When I forget to save a doc I want the timer to kick in and show me the message box with the option to save or not. There are other times that I save a doc almost every 2 or 3 minutes, that is when I use the Command+S and do not need to have the message box appear. Is this a little clearer? Thanks for your help-
|
#8
|
||||
|
||||
![]()
In that case, you might need to re-assign the Ctrl-S shortcut to point to your macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
How bout a simple save macro that I can assign to an other shortcut?
|
#10
|
||||
|
||||
![]()
The point of changing Ctrl-S is so it resets your timer. Using another shortcut means you need to remember to use that instead of Ctrl-S.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
FYI you cannot override the Command+S shortcut on a Mac. So I did another simple macro that I trigger with the Ctrl+S shortcut. I think I can remember this combo.
Code:
Sub Save2() 'Extra Save macro ActiveDocument.Save Application.StatusBar = "Brent Saved: " & ActiveDocument.Name End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
I was working on it had my auto save set to every 4 mins and all was well | VernonMax | Word | 2 | 05-18-2015 08:58 AM |
Auto save emails to server | Chuuuuck | Outlook | 1 | 11-03-2011 02:17 PM |