Is there a way to get all contacts id's from outlook 2013 or 2007 to datagridview or combobox.collection list.
Yes. There are a number of APIs out there, including one that comes with Office, that will support this functionality.
Add reference to "Microsoft Outlook xx.x Object Library" (where xx.x = 14.0, 12.0, etc):
* Click "Project"
* Select "Add Reference"
* Click "COM"
* Select "Microsoft Outlook 14.0 Object Library"
Add Imports statement:
Private Sub getContacts() 'create new instance of Outlook.Application Dim outlookApp As Outlook.Application = New Outlook.Application() 'create new instance of Outlook.MAPIFolder Dim outlookMapiFolder As Outlook.MAPIFolder = Nothing 'create new instance of Outlook.Items Dim outlookItems As Outlook.Items = Nothing 'set outlookMapiFolder to Contacts folder outlookMapiFolder = outlookApp.GetNamespace("MAPI").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts) 'get items from contacts outlookItems = outlookMapiFolder.Items For i As Integer = 0 To outlookItems.Count - 1 Dim contact As Outlook.ContactItem = outlookItems(i + 1) Dim entryId As String = contact.EntryID Dim fullName As String = contact.FullName Dim companyName As String = contact.CompanyName Dim email1Address As String = contact.Email1Address Dim email1AddressType As String = contact.Email1AddressType Dim businessTelephoneNumber As String = contact.BusinessTelephoneNumber Dim homeTelephoneNumber As String = contact.HomeTelephoneNumber Dim mobileTelephoneNumber As String = contact.MobileTelephoneNumber 'add any additional entries that you want to retrieve 'add entryId and fullName to dataGridView1 'where DataGridView1 is a DataGridView with 'columns "entryId" and "fullName" DataGridView1.Rows.Add(entryId, fullName) Next End Sub
Adapted from: Get Outlook Contacts in to C# form based Application
Edited 2 Years Ago by cgeier
i want to get contacts from Global Address List
i just want to retrive contact list no modification to Global Address List.
how to specify Global Address List folder name.
The code above is not for Exchange.
These may be of use:
I don't have access to an Exchange server to test the code.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...