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
Add a Namespace: using Microsoft.WindowsMobile.PocketOutlook;
Add an Assembly: Microsoft.WindowsMobile.PocketOutlook
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
精彩评论