Execute My Code on Menu Option

  • Thread starter Thread starter Mike H.
  • Start date Start date
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top