read from distribution list outlook
i use this macro yto read and import from a list:
Elenco Indirizzi Globale/A.T.C.B. - Utenti
the name of users, but i would want to read and import other info for example: alis,Addres, Office..ecc.., how can?
Global RIGA As String
Sub ELENCO()
Range("A2:B50000").ClearContents
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myGAddressList = myNameSpace.AddressLists("Elenco Indirizzi Globale")
Set myGEntries = myGAddressList.AddressEntries
RIGA = 2
For Each lista In myGEntries
If lista = "A.T.C.B. - Utenti" Then
Range("A" + RIGA) = UCase(lista)
For Each NOM In lista.Members
Range("B" + RIGA) = UCase(NOM)
RIGA = RIGA + 1
Next NOM
Exit For
End If
Next lista
Range("A2").Select
'Call Worksheet_SelectionChange
MsgBox ("IMPORT TERMINATO!")
End Sub
Re: read from distribution list outlook
Looks like your trying to read the Global Adress List. For this you need to use CDO to access the Alias field. Check the link in my signature for an example doing just this.
:)
Re: read from distribution list outlook
Quote:
Originally Posted by RobDog888
Looks like your trying to read the Global Adress List. For this you need to use CDO to access the Alias field. Check the link in my signature for an example doing just this.
:)
Hi RobDog888, tks for reply, but to modify my code with yiour suggestion not is for me;-( i not have the capcity and knoledgment, if yuo have a time.....
Re: read from distribution list outlook
The majority of the fields are available from using the Outlook Object Model but the Alias fields, email address, etc are only available to read by using CDO 1.21. Do you have CDO 1.21 installed?
Re: read from distribution list outlook
Quote:
Originally Posted by RobDog888
The majority of the fields are available from using the Outlook Object Model but the Alias fields, email address, etc are only available to read by using CDO 1.21. Do you have CDO 1.21 installed?
Hummm... Sorry but where is CDO x.xx?
And if i not have this component?
Sorry Rob pheraphs you have contact with a guru as you.... i not a guru but a newbie...have patince with me;-) But i give you only a gift, a "virtual" pizza and coffe from Napoli. I am Napolitan;-)
Re: read from distribution list outlook
Quote:
Originally Posted by RobDog888
The majority of the fields are available from using the Outlook Object Model but the Alias fields, email address, etc are only available to read by using CDO 1.21. Do you have CDO 1.21 installed?
in other case i have read your note and i have Outlook 2000 and i hope alreday have this comopnent...
Re: read from distribution list outlook
I believe it does come with Outlook 2000 but its not a default installed item as you need to select the component from the options in the custom installations choice.
If you modify your installation it will show what options are instanned.
Re: read from distribution list outlook
Quote:
Originally Posted by RobDog888
I believe it does come with Outlook 2000 but its not a default installed item as you need to select the component from the options in the custom installations choice.
If you modify your installation it will show what options are instanned.
hi, RobDog888 is this correct? if not how to install cdo 1.21?
Re: read from distribution list outlook
Those are a different type of library. You need to go into your Control Panel > Add/Remove Programs > Update/Modify your VB or VS 6 installation and when it comes up with the wizard screen, select Modify > then select the options you want to add/remove but in this case you only want to add the CDO 1.21 Library.
Re: read from distribution list outlook
Quote:
Originally Posted by RobDog888
Those are a different type of library. You need to go into your Control Panel > Add/Remove Programs > Update/Modify your VB or VS 6 installation and when it comes up with the wizard screen, select Modify > then select the options you want to add/remove but in this case you only want to add the CDO 1.21 Library.
... sorry but i not use the native Vb or VB6 i use onlu the standard VBA in Excel...
Re: read from distribution list outlook
Sorry, my mistake, should be your Office 2000 installation.