Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to accsess contacts of outlook through VB.NET ?
 

How to accsess contacts of outlook through VB.NET ?

Hi..
I want to access contacts from outlook 2007 by using VB.NET  8.0
How can I do it ?
Tell me some basic step and procedure...


bnilesh
Nilesh bahirshet  Sunday, October 04, 2009 9:10 AM
You Should use Microsoft.Office.Interop.Outlook

dim insApplication as new Microsoft.Office.Interop.Outlook.Application
dim insOutlookNameSpace as Microsoft.Office.Outlook.NameSpace
dim insContactsFolder as Microsoft.Office.Outlook.MAPIFolder
 insOutlookNameSpace = insApplication.GetNamespace("MAPI")
insContactsFolder = insOutlookNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
for each ci as ContactItem in insContactsFolder.Items
Console.WriteLine(ci.FullName)
next
Tamer Oz  Sunday, October 04, 2009 9:53 AM
You Should use Microsoft.Office.Interop.Outlook

dim insApplication as new Microsoft.Office.Interop.Outlook.Application
dim insOutlookNameSpace as Microsoft.Office.Outlook.NameSpace
dim insContactsFolder as Microsoft.Office.Outlook.MAPIFolder
 insOutlookNameSpace = insApplication.GetNamespace("MAPI")
insContactsFolder = insOutlookNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
for each ci as ContactItem in insContactsFolder.Items
Console.WriteLine(ci.FullName)
next
Tamer Oz  Sunday, October 04, 2009 9:53 AM
This is not the right forum in which to post your question.

Do you want to use Visual Studio Tools for Office, or use OLE Automation/COM Interop as noted below by Tamer Oz, which would just be a regular VB project?

Please post back and I will redirect you to the appropriate forum where you will get more response.

RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev
RobinDotNet  Monday, October 05, 2009 1:14 AM

You can use google to search for other answers

Custom Search

More Threads

• Please help me! ClickOnce application cannot be started. Value does not fall within the expected range. Source: System.Deployment
• invoke exe during installation - custom action issue
• ClickOnce SQL Server 2005 Database Attach Fails
• Bootstrapper problems
• customize application .exe.config file after publish
• Installing 3rd party prerequisite with bootstrapper and multiple MSIs support using ClickOnce
• Can VSTO project publish by ClickOnce ?
• Setup projects and build events
• windows service setup error
• Deploying VS2008 Help