|
-
Nov 11th, 2005, 05:44 AM
#1
Thread Starter
PowerPoster
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
-
Nov 12th, 2005, 01:08 PM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2005, 01:41 PM
#3
Thread Starter
PowerPoster
Re: read from distribution list outlook
 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.....
-
Nov 12th, 2005, 01:53 PM
#4
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2005, 02:16 PM
#5
Thread Starter
PowerPoster
Re: read from distribution list outlook
 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;-)
Last edited by luca90; Nov 12th, 2005 at 02:21 PM.
-
Nov 12th, 2005, 02:19 PM
#6
Thread Starter
PowerPoster
Re: read from distribution list outlook
 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...
-
Nov 12th, 2005, 02:28 PM
#7
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2005, 03:40 PM
#8
Thread Starter
PowerPoster
Re: read from distribution list outlook
 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?
Last edited by luca90; Jan 11th, 2009 at 06:35 AM.
-
Nov 12th, 2005, 04:03 PM
#9
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2005, 04:09 PM
#10
Thread Starter
PowerPoster
Re: read from distribution list outlook
 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...
-
Nov 12th, 2005, 04:15 PM
#11
Re: read from distribution list outlook
Sorry, my mistake, should be your Office 2000 installation.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|