Control Outlook event

M

Martin

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.
 
K

Ken Slovak - [MVP - Outlook]

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.
 
M

Martin

I'm actually using Microsoft CRM which embeds itself into Outlook via a COM
add-in. "Track in CRM" is a button that invokes the process of moving
Outlook items into the CRM database. Thought there would be some sort of
event that could be tapped into.

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.
 
K

Ken Slovak - [MVP - Outlook]

If you can get a handle to the button object you can try to intercept it's
Click event.

Other than that it depends on whether or not the CRM program exposes a
programming API, something Outlook developers wouldn't know anything about.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top