A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Control Outlook event



 
 
Thread Tools Search this Thread Display Modes
  #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.


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


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

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.

"Ken Slovak - [MVP - Outlook]" wrote in message
...
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.


  #4  
Old October 17th 06, 05:46 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Control Outlook event

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.

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
getting calendar event reminder for deleted event [email protected] Outlook - General Queries 3 September 4th 06 03:11 PM
Binding a Control to an ADODC Control, Is it possible Andrew Sampels Outlook - Using Forms 1 August 8th 06 11:02 PM
Outlook view control and one process [email protected] Outlook and VBA 6 June 5th 06 10:21 AM
Outlook view control and one process [email protected] Outlook - General Queries 2 May 31st 06 06:59 PM
How to handling Custom Form Control Event in VB Com Add-In? Raphaël ZHOU \(Jadiam\) Outlook - Using Forms 1 January 11th 06 08:31 AM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.