what's the best way to not respond to Outlook actions on other server

Add-in Express™ Support Service
That's what is more important than anything else

what's the best way to not respond to Outlook actions on other server
don't respond to events dealing with CallPilot server 
Gordon Prince


Guest


In my Outlook Add-in I'm responding to events and things are coming along. My first test users are connected to two servers, which I wasn't in my development environment. One is a Microsoft Exchange server, the other is a CallPilot telephone server. I think my new Add-in is trying to work with all items, which is throwing error messages when users interact with the CallPilot items.

What would you recommend as a technique to test which server my Add-in is responding to, and then not respond if the server isn't Microsoft Exchange.

Thanks.
Posted 09 Nov, 2015 17:26:49 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Gordon,

You haven't described the issue. I would recommend that you debug your add-in to find what causing it. You can add a number of debug messages to your code; use System.Diagnostics.Debug.WriteLine(). You collect the messages at run time using DebugView (see http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx).


Andrei Smolin
Add-in Express Team Leader
Posted 10 Nov, 2015 07:05:16 Top
Gordon Prince


Guest


Isn't there a way to just test for which server a message has come from when it is activated? Isn't it a property of the message somewhere? Then I could test that property and decide what to do.
Posted 10 Nov, 2015 07:12:19 Top
Gordon Prince


Guest


I think I've found it:
Application.Session.ExchangeMailboxServerName

as in

    Private Sub AdxOutlookAppEvents1_InspectorActivate(sender As Object, inspector As Object, folderName As String) Handles AdxOutlookAppEvents1.InspectorActivate
        Dim myInsp As Outlook.Inspector = CType(inspector, Outlook.Inspector)
        Dim outlookItem As Object = inspector.CurrentItem
        If TypeOf myInsp.CurrentItem Is Outlook.MailItem Then
            Dim myMailItem As Outlook.MailItem = CType(outlookItem, Outlook.MailItem)
            If myMailItem.Application.Session.ExchangeMailboxServerName = "xxx" then
                ' disconnect from the currently connected item 
                itemEvents.RemoveConnection()
                ' connect to events of myMailItem 
                itemEvents.ConnectTo(myMailItem, True)
            end if
        Else
            Marshal.ReleaseComObject(outlookItem)
        End If
    End Sub
Posted 10 Nov, 2015 07:16:15 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Thank you for posting your findings here.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2015 04:17:16 Top