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 all items in the Global address list



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 3rd 07, 07:56 PM posted to microsoft.public.outlook.program_vba
Brad
external usenet poster
 
Posts: 78
Default Export all items in the Global address list

Thanks for taking the time to read my question.

I've done quite a bit of coding in MS Access and Excel, but never in
Outlook. I'd like to export all the items in the GAL to something like an
Excel file, or even a .csv. I have no idea where to start or finish. I've
been looking on line for a while but haven't found anything I understand.
I'm self taught in VBA, and know enough to get done what I need to.

Any help would be really appreciated.

Brad
Ads
  #2  
Old July 3rd 07, 08:01 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Export all items in the Global address list

You might want to start with the sample at http://www.outlookexchange.com/artic...agaev_c1p2.asp, which uses ADSI, not Outlook.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Brad" wrote in message ...
Thanks for taking the time to read my question.

I've done quite a bit of coding in MS Access and Excel, but never in
Outlook. I'd like to export all the items in the GAL to something like an
Excel file, or even a .csv. I have no idea where to start or finish. I've
been looking on line for a while but haven't found anything I understand.
I'm self taught in VBA, and know enough to get done what I need to.

Any help would be really appreciated.

Brad

  #3  
Old July 3rd 07, 08:38 PM posted to microsoft.public.outlook.program_vba
Brad
external usenet poster
 
Posts: 78
Default Export all items in the Global address list

Here is what I have so far. How do I get all the other e-mail address
associated with each entry?

Thanks,

Brad



Sub GetGAL()
Dim x As Integer
Dim gal As String

On Error GoTo GetGAL_Err

Set myAddressList = Application.Session.AddressLists("Global Address
List").AddressEntries

Open "C:\Documents and Settings\Mcintybd\Desktop\EmailInfo.txt" For Output
As #1 ' Open file for output.
x = 1
Do Until x = 4000
Print #1, myAddressList(x).Details
'Debug.Print NextItem
x = x + 1
Loop
Close #1

GetGAL_Exit:
Exit Sub

GetGAL_Err:
MsgBox Err.Number & ", " & Err.Description
If Err.Number = 55 Then
Close #1
Resume
Else
Resume GetGAL_Exit
End If
End Sub





"Sue Mosher [MVP-Outlook]" wrote:

You might want to start with the sample at http://www.outlookexchange.com/artic...agaev_c1p2.asp, which uses ADSI, not Outlook.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Brad" wrote in message ...
Thanks for taking the time to read my question.

I've done quite a bit of coding in MS Access and Excel, but never in
Outlook. I'd like to export all the items in the GAL to something like an
Excel file, or even a .csv. I have no idea where to start or finish. I've
been looking on line for a while but haven't found anything I understand.
I'm self taught in VBA, and know enough to get done what I need to.

Any help would be really appreciated.

Brad


  #4  
Old July 3rd 07, 09:59 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Export all items in the Global address list

Short answer: You don't. The data you can return with Outlook objects is limited to the Exchange address, the user name, and the manager name.

That's why I suggested that you use ADSI/LDAP. In that other sample, this is the statement that tells the script what to export:

com.CommandText = "select givenname, sn,objectCategory,objectClass, mail,msExchHideFromAddressLists _
& from '" & LDAPQUERY & "' where objectClass= 'user' order by sn " _

& or objectClass= 'contact' order by sn"

An ADSI/LDAP reference or the microsoft.public.exchange.development newsgroup can probably help you out with the other field names you might be looking for. It's not information I have at my fingertips here, since it's not directly Outlook related.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Brad" wrote in message ...
Here is what I have so far. How do I get all the other e-mail address
associated with each entry?

Thanks,

Brad



Sub GetGAL()
Dim x As Integer
Dim gal As String

On Error GoTo GetGAL_Err

Set myAddressList = Application.Session.AddressLists("Global Address
List").AddressEntries

Open "C:\Documents and Settings\Mcintybd\Desktop\EmailInfo.txt" For Output
As #1 ' Open file for output.
x = 1
Do Until x = 4000
Print #1, myAddressList(x).Details
'Debug.Print NextItem
x = x + 1
Loop
Close #1

GetGAL_Exit:
Exit Sub

GetGAL_Err:
MsgBox Err.Number & ", " & Err.Description
If Err.Number = 55 Then
Close #1
Resume
Else
Resume GetGAL_Exit
End If
End Sub





"Sue Mosher [MVP-Outlook]" wrote:

You might want to start with the sample at http://www.outlookexchange.com/artic...agaev_c1p2.asp, which uses ADSI, not Outlook.

"Brad" wrote in message ...
Thanks for taking the time to read my question.

I've done quite a bit of coding in MS Access and Excel, but never in
Outlook. I'd like to export all the items in the GAL to something like an
Excel file, or even a .csv. I have no idea where to start or finish. I've
been looking on line for a while but haven't found anything I understand.
I'm self taught in VBA, and know enough to get done what I need to.

Any help would be really appreciated.

Brad


  #5  
Old July 3rd 07, 10:08 PM posted to microsoft.public.outlook.program_vba
Brad
external usenet poster
 
Posts: 78
Default Export all items in the Global address list

Aaaaahhhhh I get it.

Thanks so much for your help Sue.

Have a great day,

Brad

"Sue Mosher [MVP-Outlook]" wrote:

Short answer: You don't. The data you can return with Outlook objects is limited to the Exchange address, the user name, and the manager name.

That's why I suggested that you use ADSI/LDAP. In that other sample, this is the statement that tells the script what to export:

com.CommandText = "select givenname, sn,objectCategory,objectClass, mail,msExchHideFromAddressLists _
& from '" & LDAPQUERY & "' where objectClass= 'user' order by sn " _

& or objectClass= 'contact' order by sn"

An ADSI/LDAP reference or the microsoft.public.exchange.development newsgroup can probably help you out with the other field names you might be looking for. It's not information I have at my fingertips here, since it's not directly Outlook related.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Brad" wrote in message ...
Here is what I have so far. How do I get all the other e-mail address
associated with each entry?

Thanks,

Brad



Sub GetGAL()
Dim x As Integer
Dim gal As String

On Error GoTo GetGAL_Err

Set myAddressList = Application.Session.AddressLists("Global Address
List").AddressEntries

Open "C:\Documents and Settings\Mcintybd\Desktop\EmailInfo.txt" For Output
As #1 ' Open file for output.
x = 1
Do Until x = 4000
Print #1, myAddressList(x).Details
'Debug.Print NextItem
x = x + 1
Loop
Close #1

GetGAL_Exit:
Exit Sub

GetGAL_Err:
MsgBox Err.Number & ", " & Err.Description
If Err.Number = 55 Then
Close #1
Resume
Else
Resume GetGAL_Exit
End If
End Sub





"Sue Mosher [MVP-Outlook]" wrote:

You might want to start with the sample at http://www.outlookexchange.com/artic...agaev_c1p2.asp, which uses ADSI, not Outlook.

"Brad" wrote in message ...
Thanks for taking the time to read my question.

I've done quite a bit of coding in MS Access and Excel, but never in
Outlook. I'd like to export all the items in the GAL to something like an
Excel file, or even a .csv. I have no idea where to start or finish. I've
been looking on line for a while but haven't found anything I understand.
I'm self taught in VBA, and know enough to get done what I need to.

Any help would be really appreciated.

Brad


 




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
? posting an item from Address Book [Global Address List] to a specific form and folder luckily Outlook - Using Forms 3 September 11th 06 10:01 PM
How to print Global Address List, or export to Contacts List? Duane Outlook - Using Contacts 1 August 11th 06 01:51 AM
Extract email addresses from Distribution LIst in Global Address List tthomas Outlook and VBA 2 June 22nd 06 12:02 AM
Can I export a Global Address List to Excel? Josh Craig Outlook - Using Contacts 2 March 14th 06 01:30 PM
global global address list FrankML Outlook - Using Contacts 1 March 7th 06 10:02 AM


All times are GMT +1. The time now is 09:05 AM.


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