Hello all,
Which macro is triggered when I click the save button (or file, Save or
CTRL+S)?
I know the AutoOpen and AutoNew. Is there something like that for Save?
Russ - 04 Oct 2007 10:07 GMT
Peter,
Here are links about events.
http://word.mvps.org/faqs/macrosvba/InterceptSavePrint.htm
http://word.mvps.org/faqs/macrosvba/DocumentEvents.htm
http://word.mvps.org/faqs/macrosvba/AppClassEvents.htm
http://word.mvps.org/FAQs/MacrosVBA/PseudoAutoMacros.htm
http://msdn2.microsoft.com/en-us/library/aa140934(office.10).aspx
> Hello all,
>
> Which macro is triggered when I click the save button (or file, Save or
> CTRL+S)?
> I know the AutoOpen and AutoNew. Is there something like that for Save?

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
fumei - 04 Oct 2007 15:56 GMT
Specifically, the Save button, Ctl-S and File > Save fires the Word Sub
FileSave command.
Sub FileSave()
MsgBox "Trying to save. Not going to"
End Sub
in a document would override the command (for THAT document). Only the
messagebox would display. The file would NOT be saved.
Sub FileSave()
ActiveDocument.SaveAs Filename:="c:\yadda\NewFile.doc"
End Sub
would make the Save command do a SaveAs with the named filename.
Sub FileSave()
ActiveDocument.Close wdDoNotSaveChanges
End Sub
would make the Save command close the document, without saving any changes.