View Single Post
  #1  
Old October 16th 06, 07:06 PM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 2
Default Control Outlook event

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