Contact Details from Appointment Item

P

pratikasthana17

Hi,

I want those contact details who are in appointment,I am able to get
the Name of attendee with following code.But i am not able to get his
corresponding Mobile/Telephone Number




Code:
--------------------

int i = 0;
int j=0;
Outlook.Recipients rec;
Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
oNS.Logon(Type.Missing, Type.Missing, false, true);
Outlook.MAPIFolder Ocalender = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar );
Outlook.Items oItems = Ocalender.Items;
int iNumContacts = oItems.Count;


DataSet ds_temp = new DataSet();
DataTable dtable_temp = new DataTable("Temp_Table");

dtable_temp.Columns.Add("Sr. No.");
dtable_temp.Columns.Add("Name");
dtable_temp.Columns.Add("Phone");
dtable_temp.Columns.Add("Check", typeof(bool));

DataRow dr_temp;

if (iNumContacts != 0)
{
for (i = 1; i <= iNumContacts; i++)
{
dr_temp = dtable_temp.NewRow();
Outlook.AppointmentItem c = (Outlook.AppointmentItem)(oItems);
rec = c.Recipients ;

for (j = 1; j <= rec.Count; j++)
{
string re = rec[j].AddressEntry.Name ;
}
}
}

--------------------


Can u help me

Thanks in Advance

Pratik Asthana
 
D

Dmitry Streblechenko

Outlook has no idea that you happen to have a contact with teh same e-mail
address as a meetign attendee.
The best you can do is read the value of the attendee e-mail address, then
search (Items.Find) for a matching contact in the default (or any other)
Contacts folder.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top