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

How to obtain the Distribution List of a Sender



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 30th 09, 03:38 PM posted to microsoft.public.outlook.program_vba
Alberto[_2_]
external usenet poster
 
Posts: 28
Default How to obtain the Distribution List of a Sender

Hello,

I'd like to know if it's possible to find if the sender of a mail over
Exchange server is a member of an specific Distribution List (in Exchange) so
this mail can be automatically marked. In other words, i´d like to konw if i
can acces the organizational address book. I'm afraid no but i ask here to
confirm it.

I'm using Outlook 2003. If i used Outlook 2007 would it be possible?

The solution should't show any prompts because a macro has to do this job on
the Inbox folder automatically.

Lot of thanks,

Alberto.

Ads
  #2  
Old November 30th 09, 04:37 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to obtain the Distribution List of a Sender

The GAL (Global Address List) is available as one of the members of the
AddressLists collection. You can iterate that collection to find the GAL or
ask for it directly using the Item member of the collection. Once you have
that AddressList you can get its AddressEntries collection and iterate that
to get a specific DL and then get its members.

That will work in Outlook 2003.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Alberto" wrote in message
...
Hello,

I'd like to know if it's possible to find if the sender of a mail over
Exchange server is a member of an specific Distribution List (in Exchange)
so
this mail can be automatically marked. In other words, i´d like to konw
if i
can acces the organizational address book. I'm afraid no but i ask here to
confirm it.

I'm using Outlook 2003. If i used Outlook 2007 would it be possible?

The solution should't show any prompts because a macro has to do this job
on
the Inbox folder automatically.

Lot of thanks,

Alberto.


  #3  
Old December 1st 09, 10:56 AM posted to microsoft.public.outlook.program_vba
Alberto[_2_]
external usenet poster
 
Posts: 28
Default How to obtain the Distribution List of a Sender


Thanks Ken,

it really helps me, I can read the members of a DL but the other way would
be esaier for me, I mean, to obtain the DLs a sernder of a mail is member
of through the GAL. I'm afraid this way is not possible with only de VBA
object model.

Alberto


"Ken Slovak - [MVP - Outlook]" wrote:

The GAL (Global Address List) is available as one of the members of the
AddressLists collection. You can iterate that collection to find the GAL or
ask for it directly using the Item member of the collection. Once you have
that AddressList you can get its AddressEntries collection and iterate that
to get a specific DL and then get its members.

That will work in Outlook 2003.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Alberto" wrote in message
...
Hello,

I'd like to know if it's possible to find if the sender of a mail over
Exchange server is a member of an specific Distribution List (in Exchange)
so
this mail can be automatically marked. In other words, i´d like to konw
if i
can acces the organizational address book. I'm afraid no but i ask here to
confirm it.

I'm using Outlook 2003. If i used Outlook 2007 would it be possible?

The solution should't show any prompts because a macro has to do this job
on
the Inbox folder automatically.

Lot of thanks,

Alberto.


.

  #4  
Old December 1st 09, 06:28 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to obtain the Distribution List of a Sender

VBA is irrelevant, it would be the same with VB6, VB.NET, C# or any other
language. The limitations are what's available in the Outlook object model.
Even other lower level API's wouldn't let you query which DL's a person
belongs to, perhaps an LDAP query might do that. That I'm not sure of, I
rarely use LDAP.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Alberto" wrote in message
...

Thanks Ken,

it really helps me, I can read the members of a DL but the other way would
be esaier for me, I mean, to obtain the DLs a sernder of a mail is
member
of through the GAL. I'm afraid this way is not possible with only de VBA
object model.

Alberto


  #5  
Old December 2nd 09, 05:11 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to obtain the Distribution List of a Sender

Actually on the MAPI level, PR_EMS_AB_IS_MEMBER_OF_DL property can be
retrieved as IMAPITable. It will list all the DLs that the giveb user is a
member of.
plug
Redemption exposes PR_EMS_AB_IS_MEMBER_OF_DL as
theRDOAddressEntry.IsMemberOfDL property -
http://www.dimastr.com/redemption/rd...dressEntry.htm

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set AddressEntry = Session.AddressBook.GAL.ResolveName("dmitry")
Debug.Print "-- Delegates (who can send of behalf of " & AddressEntry.Name
& ")"
for each AE in AddressEntry.Delegates
Debug.Print AE.Name
next
Debug.Print "-- Is delegate for (can send on behalf of these users)"
for each AE in AddressEntry.IsDelegateFor
Debug.Print AE.Name
next
Debug.Print "-- Is member of the following Dist Lists:"
for each AE in AddressEntry.IsMemberOfDL
Debug.Print AE.Name
next
Debug.Print "-- The following users report to " & AddressEntry.Name
for each AE in AddressEntry.Reports
Debug.Print AE.Name
next

/plug

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Ken Slovak - [MVP - Outlook]" wrote in message
...
VBA is irrelevant, it would be the same with VB6, VB.NET, C# or any other
language. The limitations are what's available in the Outlook object
model. Even other lower level API's wouldn't let you query which DL's a
person belongs to, perhaps an LDAP query might do that. That I'm not sure
of, I rarely use LDAP.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Alberto" wrote in message
...

Thanks Ken,

it really helps me, I can read the members of a DL but the other way
would
be esaier for me, I mean, to obtain the DLs a sernder of a mail is
member
of through the GAL. I'm afraid this way is not possible with only de VBA
object model.

Alberto




 




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
unable to obtain list of tables from data source when mail mergin Pam Outlook - Using Contacts 1 November 9th 08 04:00 AM
embedded distribution list to new distribution list in outlook Brad Tulin Outlook - Using Contacts 2 October 22nd 08 01:20 AM
Temporarily Exclude sender ABC from distribution list מיכאל (מיקי) אבידן® Outlook and VBA 6 February 5th 08 07:46 PM
unable to obtain list of tables from the data source Hal Outlook - Using Contacts 2 February 27th 07 05:52 PM
Junk mail: How to create a button for "Add sender to blocked sender list" Nananana Outlook - General Queries 2 February 2nd 06 12:37 PM


All times are GMT +1. The time now is 03:39 PM.


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