G
Guest
hi,
I am writing outlook-addin application using C#. I am trying to import
contact information (from text file) in Outlook using C# code. Below is my
code. But once data is saved the Contact screen is not closing. I don't want
to display any screens. I have tried
oCustomContact.Display(false); but still it is displaying. Is there is
anything I have to do? Please let me know.
TextReader reader = new StreamReader(upLoadContacts);
string Contactline;
string[] ContactInformation;
string Title, name, jobTitle, phone, mobileNo,Email;
while ((Contactline = reader.ReadLine()) != null)
{
ContactInformation = Contactline.Split(new char[] {'~'});
Title = ContactInformation[0];
name = ContactInformation[1];
jobTitle = ContactInformation[2];
phone = ContactInformation[3];
mobileNo = ContactInformation[4];
Email = ContactInformation[5];
Outlook._ContactItem oCustomContact = (Outlook._ContactItem)
oItems.Add("IPM.Contact");
oCustomContact.Title = Title;
oCustomContact.FirstName = name;
oCustomContact.JobTitle = jobTitle;
oCustomContact.HomeTelephoneNumber = phone;
oCustomContact.MobileTelephoneNumber = mobileNo;
oCustomContact.Email1Address = Email;
oCustomContact.Display(true);
oCustomContact.Save();
}
reader.Close();
}
.....
.....
I am writing outlook-addin application using C#. I am trying to import
contact information (from text file) in Outlook using C# code. Below is my
code. But once data is saved the Contact screen is not closing. I don't want
to display any screens. I have tried
oCustomContact.Display(false); but still it is displaying. Is there is
anything I have to do? Please let me know.
TextReader reader = new StreamReader(upLoadContacts);
string Contactline;
string[] ContactInformation;
string Title, name, jobTitle, phone, mobileNo,Email;
while ((Contactline = reader.ReadLine()) != null)
{
ContactInformation = Contactline.Split(new char[] {'~'});
Title = ContactInformation[0];
name = ContactInformation[1];
jobTitle = ContactInformation[2];
phone = ContactInformation[3];
mobileNo = ContactInformation[4];
Email = ContactInformation[5];
Outlook._ContactItem oCustomContact = (Outlook._ContactItem)
oItems.Add("IPM.Contact");
oCustomContact.Title = Title;
oCustomContact.FirstName = name;
oCustomContact.JobTitle = jobTitle;
oCustomContact.HomeTelephoneNumber = phone;
oCustomContact.MobileTelephoneNumber = mobileNo;
oCustomContact.Email1Address = Email;
oCustomContact.Display(true);
oCustomContact.Save();
}
reader.Close();
}
.....
.....