I want select existing BCM business contact in c# application. I have used following Code
private void SelectBusinessContact()
{
Outlook.Application _app = new Outlook.Application();
Outlook.Application olApp = (Outlook.Application)_app;
Outlook.NameSpace olNameSpace = _app.GetNamespace("MAPI");
Outlook.Folders folders = olNameSpace.Session.Folders;
Outlook.Folder bcmRootFolder = (Outlook.Folder)folders["Business Contact Manager"];
Outlook.Folder contactsFolder = (Outlook.Folder)bcmRootFolder.Folders["Contact Management"];
string strQuery = "[FileAs] = 'Anoshan Ananthan'";
Outlook.ContactItem contactItem = (Outlook.ContactItem)contactsFolder.Items.Find(strQuery);
if (contactItem != null)
{
Console.WriteLine("Contact found");
}
else
{
Console.WriteLine("Contact not found");
}
Console.ReadLine();
}
But I got "The property "FileAs" is unknown." Exception.Please let me know correct code or explanation to select BCM business contact. I have upload error message as well. Thanks in advance
private void SelectBusinessContact()
{
Outlook.Application _app = new Outlook.Application();
Outlook.Application olApp = (Outlook.Application)_app;
Outlook.NameSpace olNameSpace = _app.GetNamespace("MAPI");
Outlook.Folders folders = olNameSpace.Session.Folders;
Outlook.Folder bcmRootFolder = (Outlook.Folder)folders["Business Contact Manager"];
Outlook.Folder contactsFolder = (Outlook.Folder)bcmRootFolder.Folders["Contact Management"];
string strQuery = "[FileAs] = 'Anoshan Ananthan'";
Outlook.ContactItem contactItem = (Outlook.ContactItem)contactsFolder.Items.Find(strQuery);
if (contactItem != null)
{
Console.WriteLine("Contact found");
}
else
{
Console.WriteLine("Contact not found");
}
Console.ReadLine();
}
But I got "The property "FileAs" is unknown." Exception.Please let me know correct code or explanation to select BCM business contact. I have upload error message as well. Thanks in advance