Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

save button Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Faulhaber - 04 Oct 2007 08:29 GMT
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.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.