LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Getting Names fron Outlook

This Works great if I want everything. However I only want the names in a
specific Distribution List. Is there a way to break this down to that level?

Option Explicit

Public Sub DisplayOutlookContactNames()
Dim Outlook As Outlook.Application
Dim NameSpace As Outlook.NameSpace
Dim AddressList As AddressList
Dim Entry As AddressEntry
Dim I As Long

On Error GoTo Finally

Set Outlook = New Outlook.Application
Set NameSpace = Outlook.GetNamespace("MAPI")
Set AddressList = NameSpace.AddressLists("All Contacts")
For Each Entry In AddressList.AddressEntries
I = I + 1
Cells(I, 1).Value = Entry.Name
Next

Finally:
Outlook.Quit
Set Outlook = Nothing
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to make a forumula fron not running boxterduke Excel Discussion (Misc queries) 2 November 3rd 08 09:46 PM
how do I copy a page setup fron one workbook to another Martina Excel Discussion (Misc queries) 2 April 24th 08 03:42 PM
Export names and address into outlook Toby Excel Discussion (Misc queries) 3 November 21st 07 11:40 PM
How to use cell fron different sheet in IF statement Cyberbiker Excel Discussion (Misc queries) 5 November 14th 07 02:15 PM
Copy variable ranges fron difernte shets optimus_1973 Excel Worksheet Functions 2 January 8th 06 04:39 AM


All times are GMT +1. The time now is 10:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"