Home |
Search |
Today's Posts |
#1
|
|||
|
|||
amending the behaviour of the close button
Hello,
I have a macro which allows the user to save a document under a name they specify by pressing a button. I want to remove all other methods of saving, so while its easy to remove the buttons on the File menu and Standard toolbar, is it possible to have the Close button in the top right corner to display the same save option as in the following macro? If so, what should be added to the macro? Thanks in advance, Sub CreateBackup() ChangeFileOpenDirectory _ "\\servername\folderpath" strDocName = InputBox("Enter the name of your document.") ActiveDocument.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatDocument _ , LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False End Sub Last edited by matt101 : July 6th 07 at 01:12 PM |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
amending the behaviour of the close button
Hi matt101,
You might be able to do that but I think it depends upon your version of Word. Some versions (e.g. 2003) allow you to get at the event that happens when a document is about to close (the DocumentBeforeClose event) and if you can access that event you can arrange for your macro code to run. For details of how to do this sort of thing, check this site: http://www.word.mvps.org/FAQs/Macros...lassEvents.htm If you get stuck, post back with your version of Word and someone may be able to assist. Regards. Ed "matt101" wrote: Hello, I have a macro which allows the user to save a document under a name they specify by pressing a button. I want to remove all other methods of saving, so while its easy to remove the buttons on the File menu and Standard toolbar, is it possible to have the Close button in the top right corner to display the same save option as in the following macro? If so, what should be added to the macro? Thanks in advance, Sub CreateBackup() ChangeFileOpenDirectory _ "\\servername\folderpath" strDocName = InputBox("Enter the name of your document.") ActiveDocument.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatDocument _ , LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False End Sub -- matt101 |
#3
|
|||
|
|||
Thanks Ed!
I will take a look. Quote:
|
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
amending the behaviour of the close button
You're welcome :-)
Regards. Ed "matt101" wrote: Thanks Ed! I will take a look. Ed;270641 Wrote: Hi matt101, You might be able to do that but I think it depends upon your version of Word. Some versions (e.g. 2003) allow you to get at the event that happens when a document is about to close (the DocumentBeforeClose event) and if you can access that event you can arrange for your macro code to run. For details of how to do this sort of thing, check this site: http://www.word.mvps.org/FAQs/Macros...lassEvents.htm If you get stuck, post back with your version of Word and someone may be able to assist. Regards. Ed "matt101" wrote: - Hello, I have a macro which allows the user to save a document under a name they specify by pressing a button. I want to remove all other methods of saving, so while its easy to remove the buttons on the File menu and Standard toolbar, is it possible to have the Close button in the top right corner to display the same save option as in the following macro? If so, what should be added to the macro? Thanks in advance, Sub CreateBackup() ChangeFileOpenDirectory _ "\\servername\folderpath" strDocName = InputBox("Enter the name of your document.") ActiveDocument.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatDocument _ , LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False End Sub -- matt101 - -- matt101 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Modify custom toolbar button behaviour | Microsoft Word Help | |||
Change Behaviour of open button in Word | Microsoft Word Help | |||
Missing Close button | Microsoft Word Help | |||
Diable close button | Microsoft Word Help | |||
Close Button in Word | Microsoft Word Help |