C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






How to add Contact information to Outlook using C#


Posted Date: 01 Aug 2008    Resource Type: Code Snippets    Category: C# Syntax

Posted By: saji       Member Level: Gold
Rating:     Points: 20



The following Code segment guide you to add Contact information to Outlook ( 2003 or 2007).
you need to refer “Microsoft outlook object libary “ in you project to run this code

Note: You have to create an alias for a namespace “Microsoft.Office.Interop.Outlook” like using Outlook = Microsoft.Office.Interop.Outlook;


private void AddContact()
{
Outlook.Application outlookApp = new Outlook.Application();
Outlook.ContactItem newContact = (Outlook.ContactItem) outlookApp.CreateItem(OlItemType.olContactItem);

try
{
newContact.FirstName = "Sajid";
newContact.LastName = "PK";
newContact.Email1Address = "sajidpk@gmail.com";
newContact.PrimaryTelephoneNumber = "91 9846710428";
newContact.MailingAddressStreet = "123 AMRA.";
newContact.MailingAddressCity = "kochi";
newContact.MailingAddressState = "Keral";
newContact.Save();
newContact.Display(true);
}
catch
{
MessageBox.Show("The new contact was not saved.");
}
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Outlook  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Small sample methods on LINQ
Previous Resource: Get Contact information from outlook using C#
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use