GetItemFromID() will only return the one item that you supply the EntryID for, that's what it's designed to do.
You seem to have 2 questions here.
If you have the folder and want to get more than 1 item there iterate the folder's Items collection. That will give you every item in the folder.
For testing the type of item you can do it a couple of ways. The messy way would be to try casting an item retrieved as an Object as each type of possible Outlook item and see if that fires an exception. The better way would be to use reflection with that Object and to retrieve the Class property of the item. If it's olMail it's an email item, if olContact it's a contact item, etc.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
<kurecka[ at ]gmail.com> wrote in message news:1b61e8b3-b2bb-4c97-8add-a49f56c0e2ef[ at ]b38g2000prf.googlegroups.com...
[Quoted Text] > Hello, > I'm new to program Outlook apps. I have BCM account object and want to > find all comunication history objects in C#. > > I use following command: > object item = olNameSpace.GetItemFromID(entryID, > bcmHistoryFolder.StoreID); > but then is necessary to find out type of the object > (Outlook.ContactItem, Outlook.JournalItem, ...). There are several > items but GetIemFromID returns only the first record. > > Can anyone help me, please? > > Thanks a lot. > Regards > Radek > >
|