Find all Comunication History objects of Account


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
 
Ad

Advertisements

K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top