Get item type

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

Get item type
 
Stan




Posts: 13
Joined: 2011-06-09
Hi,

I have a requirement where I need to find out what is the type of the
Item add in 'deleted Items' folder.


var 
itemType : integer;
...
itemType := OleVariant(Folder.Items.item(1)).GetType;



This code don't work :-(

An idea ?
Posted 05 Jul, 2011 10:35:14 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hi Stan,

Every (!) object Outlook in the Outlook object model provides the Class property. The property returns a value of the http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.olobjectclass.aspxtype. You can access that property using late binding, see Type.InvokeMember in MSDN or search samples in this forum.


Andrei Smolin
Add-in Express Team Leader
Posted 05 Jul, 2011 10:57:01 Top
Stan




Posts: 13
Joined: 2011-06-09
Andrei Smolin wrote:
Every (!) object Outlook in the Outlook object model provides the Class property. The property returns a value of the OlObjectClasstype. You can access that property using late binding, see Type.InvokeMember in MSDN or search samples in this forum.


Thank you, this is exactly what I was looking.
Just one question : why 'every --> (!) <--' ?
Posted 06 Jul, 2011 02:50:57 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hi Stan,

"Every" means every. You can use this fact to check the type of any Outlook object including Application, MAPIFolder, Namespace, whatever.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Jul, 2011 04:12:37 Top