View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
spaceman33 spaceman33 is offline
external usenet poster
 
Posts: 8
Default Outlook Address Properties Excel


Hi there.

Thought I'd try this group again because been so helpful with my last couple
of queries (grovelling over now :) ).

In my address book at work, when I double click on a person's name, I get a
box showing first name, last name, Alias etc etc (this may be customised
specifically for the business, I don't know).

I can do a search through the address book for a user, but is it possible to
return details like first name, last name, more urgently alias details etc?

Following is some code I have tried, with some of it commented out because I
thought I was getting close, though I think this code may be oriented more
towards Outlook, just wondering if it's possible to get Excel VB to use it
somehow:

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myaddresslist = myNameSpace.AddressLists("Global Address List")
Set myAddressEntries = myaddresslist.AddressEntries
'how many entries in address book:
'MsgBox myAddressEntries.Count
myaddressentry = myAddressEntries.Item(myNameSpace.CurrentUser.Name )
'THIS NEXT LINE IS THE PROBLEMATIC ONE, I THINK
b = myaddressentry.Properties("alias")
MsgBox b

Thanks in advance