A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Export DL members to Excel CSV with Outlook VBA



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 17th 06, 08:04 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default Export DL members to Excel CSV with Outlook VBA

Hello all,

I need to write a VBA script that will export the members of a Exchange
Distribution List into a CSV (or a semicolon delimited txt). I did find
the following code snippet from Microsoft that runs in a cmd shell.
Could someone please help me convert this into a valid VBA script to
export the list in Excel?


I am running Outlook 2003 in a Windows 2000 enviroment with Exchange
2000. (don't ask me why.)

Thanks
Matt

[Code}

Const olFolderContacts = 10


Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")

Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems
intcount = colContacts.Count

For i = 1 To intcount
If TypeName(colContacts.Item(i)) = "DistListItem" Then
Set objDistList = colContacts.Item(i)
Wscript.Echo objDistList.DLName
For j = 1 To objDistList.MemberCount
Wscript.Echo objDistList.GetMember(j).Name & " -- " & _
objDistList.GetMember(j).Address
Next
Wscript.Echo
End If
Next

[End Code}

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I export my Outlook Address Book in CSV format? Mojohn3 Outlook - Using Contacts 3 August 30th 09 04:22 AM
Outlook 2003 no longer allows export of contact data to a CSV James Borders Outlook - Using Contacts 2 March 18th 06 08:49 PM
I want a csv export of my outlook contacts but I only get the pst Johnny Outlook - Using Contacts 4 March 8th 06 05:58 AM
Export contacts to CSV steve Outlook - Using Contacts 2 February 28th 06 06:59 PM
how to export contacts to .csv file qalias Outlook - Using Contacts 7 January 25th 06 06:01 AM


All times are GMT +1. The time now is 02:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.