DavidT543
Guest
|
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 |
|
Andrei Smolin
Add-in Express team
Posts: 18791
Joined: 2006-05-11
|
Hi David,
Thank you for the nice words.
Please see Step 14. Handling events of Outlook Items object at http://www.add-in-express.com/docs/net-outlook-addins.php. 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?
Andrei Smolin
Add-in Express Team Leader |
|
DavidT543
Guest
|
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 |
|
Andrei Smolin
Add-in Express team
Posts: 18791
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 http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx.
Andrei Smolin
Add-in Express Team Leader |
|
DavidT543
Guest
|
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 |
|