Bill Philbin
Posts: 2
Joined: 2005-04-24
|
Looking for an example to help with a project to convert vb6/vba code to vb.Net. Specifically, I'm converting an application that monitors item change events on outlook item collections.
Sample code is appreciated.
|
|
Eugene Starostin
Guest
|
Hello Bill,
As I see there is no a sample with item change event but in this forum you can find some examples for VB.NET and Outlook.
Also we have developed several sample add-ins that show how to handle Outlook events in VB.NET. They are ADX Toys and HOWTOs. |
|
Bill Philbin
Posts: 2
Joined: 2005-04-24
|
Thanks. Looked at the examples but it's not what I'm looking for. I suspect the problem is potentially with tne interop assemblies. The problem is that they may not include all the methods/properties of the base COM object.
In VB I could:
' Dim a variable withevents
Public WithEvents colItems As Outlook.Items
' Set the variable to a collection change event (e.g. itemadd)
Set colItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
'create a procedure that would fire when the event was triggered.
Private Sub ColItems_ItemAdd(ByVal item As Object)
When I attempt to do the same in vb.net I get "no such interface" regardless of whether i use withevents or addhandler.
As Add-in express doesn't seem to support events on items (I could use the new mail event but want to monitor task items as well), I'm wondering if you have any idea on how to do.
Bill
|
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
|