Possible to connect OL ItemsEvents to 2 folders at the same time??

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

Possible to connect OL ItemsEvents to 2 folders at the same time??
Possible to connect ItemsEvents to 2 folders at the same time?? 
d henderson




Posts: 39
Joined: 2006-03-06

I am developing an AddIn app where I need to get ItemsEvents from 2 different folders at the same time.
In the sample as shown I get events for the Calendar folder only. If I comment out the second
itemsEvents.ConnectTo() statement, I then get events for the Contacts folder only. Could you provide a brief (VB.Net MSVS2005) example showing connecting OL ItemsEvents to 2 or more folders at the same time?


Private Sub adxOutlookEvents_ExplorerActivate(ByVal sender As Object, ByVal explorer As Object) Handles adxOutlookEvents.ExplorerActivate
Dim folder As Outlook.MAPIFolder

folder = OutlookApp.Session.GetDefaultFolder_
(Outlook.OlDefaultFolders.olFolderContacts)
If Not (folder Is Nothing) Then
itemsEvents.ConnectTo(folder, True)
End If

folder= OutlookApp.Session.GetDefaultFolder_
(Outlook.OlDefaultFolders.olFolderCalendar)
If Not (folder Is Nothing) Then
itemsEvents.ConnectTo(folder, True)
End If
End Sub

Thanks-DH
Posted 25 Sep, 2006 23:32:34 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Don.

You just need to add two (or more) the OutlookItemsEvents classes using the 'ADX Outlook Items Events Class' wizard.
Posted 26 Sep, 2006 08:40:39 Top
d henderson




Posts: 39
Joined: 2006-03-06

I added a second OutlookItemsEvents class and connected it up.
Things work fine now.
Thanks again Sergey!
Posted 26 Sep, 2006 12:18:27 Top