LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Get the GAL in excel

I found a SOLUTION...with some help from another board

BE SURE TO CHECK

TOOLS | REFERENCES | Microsoft CDO 1.21 Library




Public Sub GetAddressesViaCDO()

Dim oSession As New MAPI.Session
Dim colCDORecips As MAPI.Recipients
Dim objCDORecip As MAPI.Recipient
Dim sRecipTo As String
Dim sRecipCc As String
Dim sRecipBcc As String
Dim sType As String

'Start CDO session
' IF you are having problems here, switch both FALSE's to TRUE
oSession.Logon , , False, False

' show address book
Set colCDORecips = oSession.AddressBook(Title:="1. ENTER NAME _
2. PRESS SELECT 3.PRESS OK", _
forceresolution:=True, reciplists:=1, tolabel:="Select")

For Each objCDORecip In colCDORecips
If objCDORecip.Type = 1 Then
sRecipTo = sRecipTo & "" & objCDORecip.Name
End If
Next

'Enter Recipient into ActiveCELL

AddRecipsViaCDO = sRecipTo
oSession.Logoff
ActiveCell = AddRecipsViaCDO

'Free up Memory
Set colCDORecips = Nothing
Set objCDORecip = Nothing
Set oSession = 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



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

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

About Us

"It's about Microsoft Excel"