Track Items.itemchange event

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

Track Items.itemchange event
How do I track changes to items in a Calendar Folder 
DavidT543




Posts: 21
Joined: 2010-06-02
Hi Guys,

I'm just creating my first Add-in Express add-in and I love the product. Up to now I've developed a bunch of COM add-ins in VB6 with Redemption RDO, and I really appreciate how easy you make the user interface.

I want to track changes to start/end time of items in the Outlook calendar Folder. I would like to do this for items that are changed without being opened as well as items that are opened.

In Outlook/Redemption I would set a property for the folder items and trap the items.itemchange event.
I've looked in the help and searched the forums. What is the best way of doing this within Add-in Express?

David
DavidT
Posted 17 Jun, 2010 09:30:33 Top
Andrei Smolin


Add-in Express team


Posts: 17375
Joined: 2006-05-11
Hi David,

Thank you for the nice words.

Please see Step 14. Handling events of Outlook Items object at Developing Outlook Add-ins. In the screenshot shown in that section, you'll see the required class. You need to implement the ProcessItemChange method of that class.

Does this help?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Jun, 2010 09:46:02 Top
DavidT543




Posts: 21
Joined: 2010-06-02
Hi,

thanks for v.fast response last time.

The post you pointed me too gave me a good start, but I can't work out how to connect an individual item to the ItemEvents (singular item - not Items).

So far I have tried:

Private Sub adxOutlookEvents_InspectorActivate(ByVal sender As System.Object, ByVal inspector As System.Object, ByVal folderName As System.String) Handles adxOutlookEvents.InspectorActivate
Try
Select Case inspector.currentitem.class
Case Outlook.OlObjectClass.olAppointment
ItemEvents.ConnectTo(inspector.CurrentItem, True)
MsgBox("Connected")
End Select
Catch ex As Exception

End Try
End Sub

Which connects my item to the ItemEvents class, but the events don't appear to fire. For example in the itemevents class I have tries to trap when the item is saved (merely to use an easy event to trap for ttesting):

Public Overrides Sub ProcessWrite(ByVal E As AddinExpress.MSO.ADXCancelEventArgs)
Try
MsgBox("You are saving ")

Catch ex As Exception

End Try
End Sub

It never fires.

Can you tell me where I should connect an event in order to get it to fire.
Do I need to create a new ItemEvent object for each item I want to track?

thanks

David
DavidT
Posted 21 Jun, 2010 06:46:31 Top
Andrei Smolin


Add-in Express team


Posts: 17375
Joined: 2006-05-11
Hi David,

A raw sketch:

if ItemEvents IsNot Nothing Then ItemEvents.RemoveConnection()
ItemEvents = New OutlookItemEventsClass1(Me)
ItemEvents.ConnectTo(inspector.CurrentItem, True) 


And please, don't use message boxes when debugging an Office add-in. Instead, use System.Diagnostics.Debug.WriteLine and the DebugView utility.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Jun, 2010 08:20:35 Top
DavidT543




Posts: 21
Joined: 2010-06-02
Thanks again Andrei -

- for the information on add-in express and the programming hint.

I wish I had understood what value you guys added two years ago.. it would have saved me a lot of time and heartache!

David
DavidT
Posted 21 Jun, 2010 09:42:40 Top