Find all Comunication History objects of Account

  • Thread starter Thread starter kurecka
  • Start date Start date
K

kurecka

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
 
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.
 
Back
Top