Reply to: Override the File> Open menu commandMarch 17, 2009 at 6:48 pm
You should be able to override any built-in shortcut by specifying the same shortcut on your own macro. There is a field specifically for this in the Macro editor's properties window. When the resulting MCR file is built it will contain the following:
File operation event macros:
You may be interested in the event macros XMetaL Author provides for overriding the standard file operations. They may be useful here because they avoid the need to remove and recreate menu items. You simply create an event macro with one of these specific names and the corresponding functionality (exposed anywhere in the standard UI) is overridden by your own script. These events include:
|New (menu item)||File_Open_Template||Documents.OpenTemplate();|
See the Programmers Guide topic called “File operations” for details.
Note that you must define all behaviors you wish to occur including anything that would normally happen by default. So, if you override “Save” you are responsible for saving the document, either using the ActiveDocument.Save() method, or some other means (such as FSO, ADODB Stream, your own control, etc).