If i insert in address box an address similar: UFFCIO1, apper near the left a simbol "+"
In UFFCIO1, are present many users.
Possible to look in this ML and retrive the IDuser from each user.?
Via Vba for excel.
Please.
OUTLOOK in my farm... expand ML
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: OUTLOOK in my farm... expand ML
Try this:
Code: Select all
Sub Test()
Dim objOutlook As Object
Dim objNamespace As Object
Dim objGAL As Object
Dim colContacts As Variant
Dim objDistList As Object
Dim intCount As Long
Dim i As Long
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objGAL = objNamespace.AddressLists("Global Address List")
Set objDistList = objGAL.AddressEntries("UFFCIO1")
intCount = objDistList.Members.Count
For i = 1 To intCount
Debug.Print objDistList.Members.Item(i).Name & " - " & _
objDistList.Members.Item(i).ID
Next i
End Sub
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: OUTLOOK in my farm... expand ML
OPSS! see image...HansV wrote:Try this:
Code: Select all
Sub Test() Dim objOutlook As Object Dim objNamespace As Object Dim objGAL As Object Dim colContacts As Variant Dim objDistList As Object Dim intCount As Long Dim i As Long Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set objGAL = objNamespace.AddressLists("Global Address List") Set objDistList = objGAL.AddressEntries("UFFCIO1") intCount = objDistList.Members.Count For i = 1 To intCount Debug.Print objDistList.Members.Item(i).Name & " - " & _ objDistList.Members.Item(i).ID Next i End Sub
error in:
Set objGAL = objNamespace.AddressLists("Global Address List")
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: OUTLOOK in my farm... expand ML
I assumed that UFFCIO1 was a distribution list on the Exchange server of your workplace.
Where is UFFCIO1 defined? In your Contacts folder?
Where is UFFCIO1 defined? In your Contacts folder?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: OUTLOOK in my farm... expand ML
hummmmmmmmm....HansV wrote:I assumed that UFFCIO1 was a distribution list on the Exchange server of your workplace.
Where is UFFCIO1 defined? In your Contacts folder?
UFFCIO1 not is ML, but Distribution List
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: OUTLOOK in my farm... expand ML
no in my contancts but in Recipient of Outlook....HansV wrote:OK, but where? In your contacts, or ...?
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: OUTLOOK in my farm... expand ML
But the distribution list must be saved somewhere...
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: OUTLOOK in my farm... expand ML
but i dont understand, the error go in:HansV wrote:But the distribution list must be saved somewhere...
Set objGAL = objNamespace.AddressLists("Global Address List")
and not in
Set objDistList = objGAL.AddressEntries("UFFCIO1")
in this case, i think, the error not is refered to the name of ML, but when set the Object objGAL, or not?
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: OUTLOOK in my farm... expand ML
Yes, but I need to know where UFFCIO1 is stored.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: OUTLOOK in my farm... expand ML
Found solution!!!!!! stupid but found:HansV wrote:Yes, but I need to know where UFFCIO1 is stored.
Set objGAL = objNamespace.AddressLists("Elenco Indirizzi Globale")
in Italiano, work perfect!
-
- Administrator
- Posts: 78577
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: OUTLOOK in my farm... expand ML
Ah! I didn't know that the name is language-dependent.
Best wishes,
Hans
Hans