开发者

Access Windows mobile Address book

What is the code for accessing contacts from address book in windows mobile application when the contacts are stored into the windows mobile address book?

I tried:

(Microsoft.WindowsMobile.PocketOutlook.OutlookSession ss = new OutlookSession())
{
    ContactCollection mobilePhoneBook = ss.Contacts.Items;
    foreach (Contact a开发者_JAVA技巧Contact in mobilePhoneBook)
    {
        MessageBox.Show("First Name: " + aContact.FirstName.ToString()
            + "\n Mobile Number: " + aContact.MobileTelephoneNumber.ToString());
    }
}

It's giving the error:

can't find pinvoke dll 'pimstore.dll'


Here is an article specifying on how to access contacts in WinMo

I'll summarize the methods specified

  1. Add a Namespace: using Microsoft.WindowsMobile.PocketOutlook;

  2. Add an Assembly: Microsoft.WindowsMobile.PocketOutlook

  3. Access the contacts

    OutlookSession mySession = new OutlookSession();
    ContactCollection collection = mySession.Contacts.Items;
    foreach (Contact contact in collection)
    {
    //do something with contact details, e.g. write to file or update
    }

Here is the namespace that will be most useful to you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜