ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Does "Send" Have an Associated Event? (https://www.excelbanter.com/excel-programming/368565-does-send-have-associated-event.html)

roadkill

Does "Send" Have an Associated Event?
 
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

Ron de Bruin

Does "Send" Have an Associated Event?
 
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




roadkill

Does "Send" Have an Associated Event?
 
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





Ron de Bruin

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







roadkill

Does "Send" Have an Associated Event?
 
I was afraid of that but had to ask. I've implemented a less-than-desired
work around. Thanks for responding.
- Will

"Ron de Bruin" wrote:

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








All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com