View Single Post
  #2  
Old October 16th 06, 07:34 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Control Outlook event

There is no Outlook event "Track in CRM".

If you are using some CRM software it might fire an event but unless it's
exposed to your program you can't do anything with it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Martin" wrote in message
...
I need to intercept the Outlook "Track in CRM" event and fire a
confirmation message before the process continues. The problem is that the
Click event fires after the message is actually tracked. What Outlook event
can I intercept before an item is tracked?

Option Explicit
Dim WithEvents objButton As CommandBarButton

Private Sub Application_Quit()
Set objButton = Nothing
End Sub

Private Sub Application_Startup()
Set objButton = ActiveExplorer.CommandBars.Item("Microsoft
CRM").Controls.Item("Trac&k in CRM")
End Sub

Private Sub objButton_Click(ByVal Ctrl As Office.CommandBarButton, Cancel
As Boolean)
'MsgBox "I've been clicked!"
If MsgBox("Are you sure you want to send this item to CRM?", vbYesNo +
vbQuestion _
, "CRM Track Confirmation") = vbNo Then
Cancel = True
End If
End Sub

Thanks.


Ads