Extract outlook contact properties

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi all,

I have found a macro on line which populates a combobox with gloabl address book.
Further than this I am hoping I can do some automation whereby the employee number could be grabbed in VBA from the contact properties in outlook of the person I have selected.

Rther than get into detail right now i was just wondering if anyone could:
A) Tell me if this is even possible
B) Provide me with an example/ online reference I can look at to try and get my head around it and learn it for myself.

To sum up what Im doing:
I am teaching a class
I am provided with a list of student names
I sent the invite
I need need to populate an excel report sheet with the employee names but also add other properties manually like employee number etc...this is what I hope I can automate.

Thanks for any help/ support.
As always its appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Is it possible? Probably. Can we see the code you're using?

(Please post it between CODE tags - the # icon in the advanced editor toolbar.)
 
Upvote 0
Thank you both for the replies

Ruddles at the moment I have no code.

what i get is a word doc with a list of names on which i transfer to column A of an excel sheet, i then have to do 1 of 2 things

1) open up company directory and search for employee number
2) locate the person in global address list on outlook and take the employee number from the 'other' tab of the contacts properties.

I have found the following macro which puts global address list from outlook into a combo box - Im hoping and thinking along the lines of:
Combo box in column A - I choose the outlook contact from the drop down the macro has created and then adjacent cell in column B i can somehow grab the employee number from the properties.

Heres the code I have to create the combo box from my global address list:

Code:
Sub GetFromGlobalAddressList()

'write the default Outlook contact name list to the active worksheet

Dim OlApp As Object
Dim OlList As Object
Dim OlAds As Object
Dim Larray() As String
Dim i As Long

Set OlApp = CreateObject("Outlook.Application")
Set OlList = OlApp.GetNamespace("MAPI").AddressLists("Global Address List")
Set OlAds = OlList.AddressEntries

With Sheet1.ComboBox1
.Clear 'clear old address list
ReDim Larray(OlAds.Count)
For i = 1 To OlAds.Count
Larray(i) = OlAds(i)
Next i
.List() = Larray
End With

Set OlApp = Nothing

End Sub

thanks!
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,345
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top