ProcessItemAdd question

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

ProcessItemAdd question
 
Pierre-D. Savard




Posts: 41
Joined: 2007-03-23
Hi, what is the best way to found the type of the "Item as Object" pass with the ProcessItem events.

I need to track items additions in the sentitems folder but only item added are email.

Thanks
Posted 31 Mar, 2007 16:40:15 Top
Sergey Grischenko


Add-in Express team


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

You can use the 'is' C# operator to check if the object is the Outlook._MailItem.



P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 02 Apr, 2007 12:26:25 Top
Pierre-D. Savard




Posts: 41
Joined: 2007-03-23
I try that:

Public Overrides Sub ProcessItemAdd(ByVal Item As Object)
'TODO: Add some code

If Item Is Outlook.MailItem Then

End If

But i receive this error: 'MailItem' is a type in 'Outlook' and connot bu used as an expression

Any suggestion?
Posted 04 Apr, 2007 08:46:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Pierre, I meant the C# operator and not the VB.NET one.
In VB.NET it should be 'TypeOf ... is' operators. Please see the MSDN help to get more information.
Posted 04 Apr, 2007 12:13:49 Top
Pierre-D. Savard




Posts: 41
Joined: 2007-03-23
:oops:
I am shame!...
here is the syntax...

If TypeOf (unreadInboxItems(index)) Is Outlook.MailItem Then
Posted 04 Apr, 2007 14:50:48 Top