Reading contacts from outlook 2000 
Author Message
 Reading contacts from outlook 2000

Hello,

I'm a bit lost with this code. I want to retrieve the contact information
from the contacts folder. I have the folder object and know how many items
(contacts) are present but not the link to the detail information from the
contact class.

This is a part of the code.
msoutl9.MAPIFolder objMAPIFolder =
objNS.GetDefaultFolder(OlDefaultFolders.olFolderContacts);

if (objMAPIFolder.Items.Count>=1) {

    objMAPIFolder.Items.GetFirst();

    for (int i=1;i<=objMAPIFolder.Items.Count;i++) {

    // Here comes the detail information but i do not know how.

     objMAPIFolder.Items.GetNext();

   }

Quote:
}

Gerard


Mon, 22 Nov 2004 01:35:29 GMT  
 Reading contacts from outlook 2000
Maybe something like:

foreach (object o in objMAPIFolder.Items)
{
    if (o is msoutl9.ContactItem)
    {
        string fileAs = ((msoutl9.ContactItem)o).FileAs;
        string homePhone = ((msoutl9.ContactItem)o).HomeTelephoneNumber;
        ...
    }

Quote:
}

Annie



Quote:
> Hello,

> I'm a bit lost with this code. I want to retrieve the contact information
> from the contacts folder. I have the folder object and know how many items
> (contacts) are present but not the link to the detail information from the
> contact class.

> This is a part of the code.
> msoutl9.MAPIFolder objMAPIFolder =
> objNS.GetDefaultFolder(OlDefaultFolders.olFolderContacts);

> if (objMAPIFolder.Items.Count>=1) {

>     objMAPIFolder.Items.GetFirst();

>     for (int i=1;i<=objMAPIFolder.Items.Count;i++) {

>     // Here comes the detail information but i do not know how.

>      objMAPIFolder.Items.GetNext();

>    }

> }

> Gerard



Mon, 22 Nov 2004 02:27:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to access OutLook 2000 Contacts using Visual C/C++ 6.0

2. How to access OutLook 2000 Contacts using Visual C/C++ 6.0

3. read sent messages in Outlook 2000?

4. Instability using Outlook 2000 Object Model

5. Active X Control for Outlook Contacts Search crashes?

6. outlook 2000 object model

7. outlook express contacts API

8. Outlook 2000 Automation

9. Outlook Express contacts & VC++

10. Office 2000 or Outlook like menu

11. Catching Outlook 2000 event?

12. Control/Library like the Grid in Outlook contacts

 

 
Powered by phpBB® Forum Software