Execute My Code on Menu Option

M

Mike H.

Application.VBE.CommandBars.FindControl(ID:=2188).Execute

If I wish to execute my own function when the user selects the option:
File>Send to>Mail Receipient (as attachment)... the Correct ID # is 2188,
but how do I tell it to run "MySub" instead? The above line gives me an
error # 1004. Perhaps the OnAction will work, but I don't understand the
syntax for it. Thanks.
 
H

Héctor Miguel

hi, Mike !
Application.VBE.CommandBars.FindControl(ID:=2188).Execute
If I wish to execute my own function when the user selects the option:
File>Send to>Mail Receipient (as attachment)... the Correct ID # is 2188
but how do I tell it to run "MySub" instead?
The above line gives me an error # 1004.
Perhaps the OnAction will work, but I don't understand the syntax for it...

you probably need to use a class module, see this thread: http://tinyurl.com/6po44f

hth,
hector.
 
Top