Overwrite Built-in Commands and Dialogs


Dialogs

Applications.Dialogs(wdWordDialog.wdEditGoTo).Show


Commands

You can write macros that run in place of Word's built-in commands.
For example if you want to overwrite the built-in command (Insert > Picture) you can create your own global macro called InsertPicture.


There is a quick way to find out what the macro name needs to be to override a built-in command.
Press (Ctrl + Alt + plus sign (on the numeric keypad)
The cursor will change
You can then select the command you want to see the name for
The macro name will be displayed in the Customise keyboard dialog box.


(Tools > Customize)(Commands tab)
Press Keyboard
SS customise keyboard


Add the following to a normal module in the active document

Public Sub FileOpen 
   Call MsgBox("this runs instead of the built-in File > Open")
End Sub


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext