View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Does "Send" Have an Associated Event?

I don't think this is possible with a few code lines

Note that the send button can have 3 options
Send Sheet
Send Selection
Send Chart

--
Regards Ron de Bruin
http://www.rondebruin.nl



"roadkill" wrote in message ...
Ron

Whoops!
I guess my description of what I want to do wasn't quite complete. I want
to trigger my code after the email has been sent (I don't want to run my code
instead of the current action taken when the button is clicked).

Also, your code attaches "mymacro" to the Email button on the Standard
toolbar. I want it to trigger from the "Send this Selection" button on the
"envelope" that is created when you click the Email button on the Standard
toolbar, but after the email has been sent.

Can this be done?

Thanks,
Will

"Ron de Bruin" wrote:

Do you want to run your own code when you press the button
Do I understand you correct ?

Run the test macro one time

Sub test()
Dim Mycontrol As CommandBarControl
Set Mycontrol = Application.CommandBars("Standard").FindControl _
(ID:=3738, Recursive:=True)
Mycontrol.OnAction = ThisWorkbook.Name & "!mymacro"
End Sub

Sub mymacro()
MsgBox "Hi"
End Sub

Use this to reset

Mycontrol.OnAction = ThisWorkbook.Name & "!mymacro"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"roadkill" wrote in message ...
Is there an event associated with clicking on the "Send This Selection"
button when using EnvelopeVisible to send a selection from a spreadsheet?
I'd like to trigger some code from this button click but can't find an event
for it.
Will