Discussion:
Redemption: DistributionList that reference another DistributionList
(too old to reply)
s***@gmail.com
2008-08-18 05:38:50 UTC
Permalink
I am looking to iterate over the members of a DistributionList. The
members can either be a contact or another DL. Using the
RDOAddressEntry.GetContact() which retruns RDOContactItem i can
retrieve the contact properties but how can i get reference to
RDODistList item in case the member is a DL, GetContact() only returns
RdoContactItem ? Does redemption expose functionality to retrieve
properties of DL which is a member of another DL? I am talking about
private DL.
Dmitry Streblechenko
2008-08-18 07:24:11 UTC
Permalink
When you iterate through the DL members using RDOAddressEntery.Members
collection, you can call RDOAddressEntry.GetContact for each member.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by s***@gmail.com
I am looking to iterate over the members of a DistributionList. The
members can either be a contact or another DL. Using the
RDOAddressEntry.GetContact() which retruns RDOContactItem i can
retrieve the contact properties but how can i get reference to
RDODistList item in case the member is a DL, GetContact() only returns
RdoContactItem ? Does redemption expose functionality to retrieve
properties of DL which is a member of another DL? I am talking about
private DL.
Sandeep
2008-08-18 07:52:52 UTC
Permalink
thanks Dmitry for reply, i called RDOAddressEntry.GetContact() method
but it returns RDOContactItem. Can't i get reference to the
RDODistListItem in anyway? I will then use the RdoDistListItem.Members
to iterate over its members.

Basically what i want to do is extract the contacts of a
DistributionList and its sub distribution lists if it contains any.

Regards,
Sandeep
Dmitry Streblechenko
2008-08-18 16:58:34 UTC
Permalink
No, you can only get back RDOContactItem
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Sandeep
thanks Dmitry for reply, i called RDOAddressEntry.GetContact() method
but it returns RDOContactItem. Can't i get reference to the
RDODistListItem in anyway? I will then use the RdoDistListItem.Members
to iterate over its members.
Basically what i want to do is extract the contacts of a
DistributionList and its sub distribution lists if it contains any.
Regards,
Sandeep
Sandeep
2008-08-21 03:25:21 UTC
Permalink
Ok this is how i got it done. I couldn't get the RDODistList handle to
sub distribution lists but achieved what i wanted to do.
When iterate over the members in RDOAddressEntry, i checked the
RDOAddressEntry.DisplayType property whose values equal to 1 or 5 mean
that either it is EX DL or private DL. Then again extract its members
to retrieve the contact items.
Kalyan
2008-11-05 10:45:01 UTC
Permalink
Hi,
I've Redemption installed with Outlook 2007. I tried out the following code
using RDO. In the following code snippet, after the 6th line "set Sesn =
CreateObject("Redemption.RDOSession")" , it doesn't work or throw any error
message.

What else is required in addition to installing Redemption? Yours assistence
is much appreciated.

function TestRedemtionDL
MsgBox "in TestRedemtionDL"
set outlookObj=CreateObject("Outlook.Application")
set sessionObj = outlookObj.GetNameSpace("MAPI")
MsgBox "in TestRedemtionDL after app"
set Sesn = CreateObject("Redemption.RDOSession")
if Err.number <> 0 or Sesn = nothing then
MsgBox "in TestRedemtionDL after RDOSession"
end if
'Sesn.Logon
Sesn.MAPIOBJECT = sessionObj.MAPIOBJECT
MsgBox " Sesn.CurrentUser.Name " & Sesn.CurrentUser.Name
MsgBox "logging in"
set AB = Sesn.AddressBook
MsgBox "After AB "
set Recips = AB.ShowAddressBook
MsgBox Recips.Count
MsgBox "Err " & Err.Description
end function

-Kalyan
Post by Sandeep
Ok this is how i got it done. I couldn't get the RDODistList handle to
sub distribution lists but achieved what i wanted to do.
When iterate over the members in RDOAddressEntry, i checked the
RDOAddressEntry.DisplayType property whose values equal to 1 or 5 mean
that either it is EX DL or private DL. Then again extract its members
to retrieve the contact items.
Ken Slovak - [MVP - Outlook]
2008-11-05 15:08:42 UTC
Permalink
Is Redemption registered?

In your test you have this line:

if Err.number <> 0 or Sesn = nothing then

You can't test for Sesn being Nothing that way, you have to test for If Sesn
Is Nothing instead.

So is Sesn nothing? Which message boxes do you get?
--
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
Post by Kalyan
Hi,
I've Redemption installed with Outlook 2007. I tried out the following code
using RDO. In the following code snippet, after the 6th line "set Sesn =
CreateObject("Redemption.RDOSession")" , it doesn't work or throw any error
message.
What else is required in addition to installing Redemption? Yours assistence
is much appreciated.
function TestRedemtionDL
MsgBox "in TestRedemtionDL"
set outlookObj=CreateObject("Outlook.Application")
set sessionObj = outlookObj.GetNameSpace("MAPI")
MsgBox "in TestRedemtionDL after app"
set Sesn = CreateObject("Redemption.RDOSession")
if Err.number <> 0 or Sesn = nothing then
MsgBox "in TestRedemtionDL after RDOSession"
end if
'Sesn.Logon
Sesn.MAPIOBJECT = sessionObj.MAPIOBJECT
MsgBox " Sesn.CurrentUser.Name " & Sesn.CurrentUser.Name
MsgBox "logging in"
set AB = Sesn.AddressBook
MsgBox "After AB "
set Recips = AB.ShowAddressBook
MsgBox Recips.Count
MsgBox "Err " & Err.Description
end function
-Kalyan
Kalyan
2008-11-06 10:25:01 UTC
Permalink
Hi Ken,
You are right. I've corrected the code. This is the error I'm getting after
'CreateObject("Redemption.RDOSession")' statement
"ActiveX component can't create object"
Err.number 429

Can you help me in using "Redemption.MAPIUtils" (instead of
Redemption.RDOSession) if the above is not possible?

-Kalyan
Post by Ken Slovak - [MVP - Outlook]
Is Redemption registered?
if Err.number <> 0 or Sesn = nothing then
You can't test for Sesn being Nothing that way, you have to test for If Sesn
Is Nothing instead.
So is Sesn nothing? Which message boxes do you get?
--
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
Post by Kalyan
Hi,
I've Redemption installed with Outlook 2007. I tried out the following code
using RDO. In the following code snippet, after the 6th line "set Sesn =
CreateObject("Redemption.RDOSession")" , it doesn't work or throw any error
message.
What else is required in addition to installing Redemption? Yours assistence
is much appreciated.
function TestRedemtionDL
MsgBox "in TestRedemtionDL"
set outlookObj=CreateObject("Outlook.Application")
set sessionObj = outlookObj.GetNameSpace("MAPI")
MsgBox "in TestRedemtionDL after app"
set Sesn = CreateObject("Redemption.RDOSession")
if Err.number <> 0 or Sesn = nothing then
MsgBox "in TestRedemtionDL after RDOSession"
end if
'Sesn.Logon
Sesn.MAPIOBJECT = sessionObj.MAPIOBJECT
MsgBox " Sesn.CurrentUser.Name " & Sesn.CurrentUser.Name
MsgBox "logging in"
set AB = Sesn.AddressBook
MsgBox "After AB "
set Recips = AB.ShowAddressBook
MsgBox Recips.Count
MsgBox "Err " & Err.Description
end function
-Kalyan
Ken Slovak - [MVP - Outlook]
2008-11-06 13:59:28 UTC
Permalink
If you're getting that error then you have to fix it before you could use
MAPIUtils. The error tells us that either Redemption is not registered
(check in HKCR\Redemption and see if that area exists and shows the various
Redemption classes), or that a script stopper is running that prevents using
CreateObject (or New or GetObject).
--
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
Post by Kalyan
Hi Ken,
You are right. I've corrected the code. This is the error I'm getting after
'CreateObject("Redemption.RDOSession")' statement
"ActiveX component can't create object"
Err.number 429
Can you help me in using "Redemption.MAPIUtils" (instead of
Redemption.RDOSession) if the above is not possible?
-Kalyan
Kalyan
2008-11-05 10:52:03 UTC
Permalink
I'm trying an VBS code to enumerate/expand the distribution list(DL) and get
the members of DL. Following code snippet is not working, member count is 0.
Could anybody please help on this. Your help is much appreciated. I did
exhaustive googling on it.

.........
set utilobj = CreateObject("Redemption.MAPIUtils")

set colCDORecips = utilobj.AddressBook(Nothing,"Select Recipient",False,
True, 1,"To")
Count = colCDORecips.Count

For i = 1 To Count
'MsgBox "redemtion " & Count
Set recipientObj = colCDORecips.Item(i)
MsgBox "recipientObj.AddressEntry.Type " &
recipientObj.AddressEntry.Type
MsgBox "recipientObj.AddressEntry.DisplayType " &
recipientObj.AddressEntry.DisplayType
MsgBox "recipientObj " & recipientObj.DisplayType
displayName=recipientObj.Name
contactType= recipientObj.AddressEntry.Type
if contactType = "EX" then
if recipientObj.AddressEntry.DisplayType = 1 then
'set Citems = recipientObj.GetMember(1)
'email=oEDL.PrimarySmtpAddress
'set SafeDist = CreateObject("Redemption.SafeDistList")
Set oDL = recipientObj
Call ShowGALInfoFromDL(recipientObj)
'SafeDist.Item=recipientObj
'SafeContact.Item=recipientObj.AddressEntries
else
email=recipientObj.AddressEntry.Fields(&H39FE001F)
addEmailItems displayName, email, mode
end if
elseif contactType = "SMTP" then
email=recipientObj.Address
addEmailItems displayName, email, mode ......
......

-Kalyan
Post by Sandeep
Ok this is how i got it done. I couldn't get the RDODistList handle to
sub distribution lists but achieved what i wanted to do.
When iterate over the members in RDOAddressEntry, i checked the
RDOAddressEntry.DisplayType property whose values equal to 1 or 5 mean
that either it is EX DL or private DL. Then again extract its members
to retrieve the contact items.
Dmitry Streblechenko
2008-11-05 19:04:00 UTC
Permalink
See my reply to your other post.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Kalyan
I'm trying an VBS code to enumerate/expand the distribution list(DL) and get
the members of DL. Following code snippet is not working, member count is 0.
Could anybody please help on this. Your help is much appreciated. I did
exhaustive googling on it.
.........
set utilobj = CreateObject("Redemption.MAPIUtils")
set colCDORecips = utilobj.AddressBook(Nothing,"Select
Recipient",False,
True, 1,"To")
Count = colCDORecips.Count
For i = 1 To Count
'MsgBox "redemtion " & Count
Set recipientObj = colCDORecips.Item(i)
MsgBox "recipientObj.AddressEntry.Type " &
recipientObj.AddressEntry.Type
MsgBox "recipientObj.AddressEntry.DisplayType " &
recipientObj.AddressEntry.DisplayType
MsgBox "recipientObj " & recipientObj.DisplayType
displayName=recipientObj.Name
contactType= recipientObj.AddressEntry.Type
if contactType = "EX" then
if recipientObj.AddressEntry.DisplayType = 1 then
'set Citems = recipientObj.GetMember(1)
'email=oEDL.PrimarySmtpAddress
'set SafeDist = CreateObject("Redemption.SafeDistList")
Set oDL = recipientObj
Call ShowGALInfoFromDL(recipientObj)
'SafeDist.Item=recipientObj
'SafeContact.Item=recipientObj.AddressEntries
else
email=recipientObj.AddressEntry.Fields(&H39FE001F)
addEmailItems displayName, email, mode
end if
elseif contactType = "SMTP" then
email=recipientObj.Address
addEmailItems displayName, email, mode ......
......
-Kalyan
Post by Sandeep
Ok this is how i got it done. I couldn't get the RDODistList handle to
sub distribution lists but achieved what i wanted to do.
When iterate over the members in RDOAddressEntry, i checked the
RDOAddressEntry.DisplayType property whose values equal to 1 or 5 mean
that either it is EX DL or private DL. Then again extract its members
to retrieve the contact items.
v***@gmail.com
2015-01-22 17:49:19 UTC
Permalink
Post by s***@gmail.com
I am looking to iterate over the members of a DistributionList. The
members can either be a contact or another DL. Using the
RDOAddressEntry.GetContact() which retruns RDOContactItem i can
retrieve the contact properties but how can i get reference to
RDODistList item in case the member is a DL, GetContact() only returns
RdoContactItem ? Does redemption expose functionality to retrieve
properties of DL which is a member of another DL? I am talking about
private DL.
Can we expand the distribution group members for standalone Redemption.. means on server where outlook is not installed?
Loading...