LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Trap the Send-To event

Thanks Peter. I'll go with that and see what happens. Otto
"Peter T" <peter_t@discussions wrote in message
...
Hi Otto,

You could trap the button click event. You didn't say which Send-to, you
have a bit control over Routing but not mail, if say user doesn't complete
the email.

'''code in normal module

Dim colButtons As Collection

Sub SinkClickEvents()
Dim ctl As CommandBarButton
Dim i As Long
Dim nID As Long
Dim vaID, vaAction
Dim cls As Class1
vaID = Array(3738, 2188, 259)
vaAction = Array("SendToMail", "SendToRecipient", "SendToRouting")

Set colButtons = New Collection
For i = LBound(vaID) To UBound(vaID)
Set ctl = Application.CommandBars.FindControl(ID:=vaID(i))
Set cls = New Class1
Set cls.pBtn = ctl
cls.psAction = vaAction(i)
colButtons.Add cls, vaAction(i)
Next
End Sub

''''''''''''''''''''''''''''''

''''code in Class1 < rename
Public WithEvents pBtn As CommandBarButton
Public psAction As String

Private Sub pBtn_Click(ByVal Ctrl As Office.CommandBarButton, _
CancelDefault As Boolean)
Dim bDlgRes As Boolean
MsgBox psAction
Select Case psAction
Case "SendToMail"
'code
Case "SendToRecipient"
'code
Case "SendToRouting"
CancelDefault = True
bDlgRes = Application.Dialogs(xlDialogRoutingSlip).Show
MsgBox "User " & IIf(bDlgRes, "processed", "pressed cancel"), , psAction
'code
End Select
End Sub

Regards,
Peter T

"Otto Moehrbach" wrote in message
...
Excel XP & Win XP
I need to increment an Invoice number before each time the Invoice sheet

is
either printed or emailed ( File - Send-To). The print and Send-To

commands
are manually, not VBA, issued
The printed part I know, but is there a way to trap the Send-To event to

run
some code?
Thanks for your time. Otto






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trap show toolbar event [email protected] Links and Linking in Excel 0 April 27th 07 04:16 PM
How to trap the worksheet_BeforeDeactivate event? OKLover[_2_] Excel Programming 1 July 12th 05 10:34 AM
Trap SheetBeforeRightClick event from another workbook mp112849 Excel Programming 2 June 15th 05 10:32 AM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
how to trap a event coming from a dll E.Anderegg Excel Programming 6 October 16th 03 01:53 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"