T
timothy.goric
I'm using VSTO 2005 (C#) to try to access a public contacts folder in
Outlook which contains about 1200 contacts. Using
Microsoft.Office.Interop.Outlook.MAPIFolder, I'm looping through all
of the Items in the contacts folder and reading them as Objects, e.g.
foreach(Object obj in folder.Items). I then check which of these
Objects are a Outlook.ContactItem and proceed to get the needed
information from each.
The problem is that only about 250 of the contacts in this public
folder are being recognized as ContactItems. I can't seem to find a
way to check the type of the Objects - Object.GetType() returns
System.__ComObject, and I can't extract any more detailed information
from it.
If I try a foreach loop on the ContactItems in the Item list, e.g.
foreach(Outlook.ContactItem contact in folder.Items), I get an error
that I cannot cast a System.__ComObject to an Outlook.ContactItem.
Does anyone have any insight on this? Is there an alternate way to
access a contact's information, or possibly a way to determine what
type of Objects (besides ContactItems) I'm dealing with?
Outlook which contains about 1200 contacts. Using
Microsoft.Office.Interop.Outlook.MAPIFolder, I'm looping through all
of the Items in the contacts folder and reading them as Objects, e.g.
foreach(Object obj in folder.Items). I then check which of these
Objects are a Outlook.ContactItem and proceed to get the needed
information from each.
The problem is that only about 250 of the contacts in this public
folder are being recognized as ContactItems. I can't seem to find a
way to check the type of the Objects - Object.GetType() returns
System.__ComObject, and I can't extract any more detailed information
from it.
If I try a foreach loop on the ContactItems in the Item list, e.g.
foreach(Outlook.ContactItem contact in folder.Items), I get an error
that I cannot cast a System.__ComObject to an Outlook.ContactItem.
Does anyone have any insight on this? Is there an alternate way to
access a contact's information, or possibly a way to determine what
type of Objects (besides ContactItems) I'm dealing with?