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

Outlook Redemption expand distribution list



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 6th 08, 05:06 AM posted to microsoft.public.outlook.program_vba
Kalyan
external usenet poster
 
Posts: 8
Default Outlook Redemption expand distribution list

I need to expand the distribution list(DL).. both DL in Exchange and
private contacts. I somewhat tried two ways of doing it but not successful
in either
method.

I've Redemption installed with Outlook 2007.

Method 1: Using Redemption.RDOSession
I tried out the following code
using RDO. I knew there is strightforward API to achieve but 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


Method 2 : Using Redemption.MAPIUtils. Partially working but not does what
exactly required.

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
' I tried all the objects related to Recipient object in Outlook API
Call ShowGALInfoFromDL(recipientObj) 'Code for the sub is
below
'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 ......
.......

Sub ShowGALInfoFromDL(dl)
MsgBox "In ShowGALInfoFromDL"
' constants for MAPI property tags
Const PR_ACCOUNT = &H3A00001E ' alias
Const PR_GIVEN_NAME = &H3A06001E ' given name
Const PR_SURNAME = &H3A11001E ' surname
Const PR_TITLE = &H3A17001E ' title
Const PR_DISPLAY_NAME = &H3001001E ' display name

Set rdl = CreateObject("Redemption.SafeDistList")
rdl.Item = dl
count = rdl.MemberCount
MsgBox "count " & count
For i = 1 To count
Set rrecip = rdl.GetMember(i)
' is it an individual contact (not a DL)?
If rrecip.DisplayType = olUser Then
' is it an Exchange user?
Set rae = rrecip.AddressEntry
If rae.Type = "EX" Then
alias = rae.Fields(PR_ACCOUNT)
display = rae.Fields(PR_DISPLAY_NAME)
first = rae.Fields(PR_GIVEN_NAME)
last = rae.Fields(PR_SURNAME)
title = rae.Fields(PR_TITLE)
MsgBox "display " & display
End If
End If
Next

Set rae = Nothing
Set rdl = Nothing
Set rrecip = Nothing
End Sub

Your help is much appreciated. Thank u in advance.

-Kalyan
Ads
  #2  
Old November 6th 08, 06:23 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Redemption expand distribution list

Did you see my reply in microsoft.public.office.developer.outlook.vba?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Kalyan" wrote in message
news
I need to expand the distribution list(DL).. both DL in Exchange and
private contacts. I somewhat tried two ways of doing it but not successful
in either
method.

I've Redemption installed with Outlook 2007.

Method 1: Using Redemption.RDOSession
I tried out the following code
using RDO. I knew there is strightforward API to achieve but 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


Method 2 : Using Redemption.MAPIUtils. Partially working but not does what
exactly required.

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
' I tried all the objects related to Recipient object in Outlook API
Call ShowGALInfoFromDL(recipientObj) 'Code for the sub is
below
'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 ......
......

Sub ShowGALInfoFromDL(dl)
MsgBox "In ShowGALInfoFromDL"
' constants for MAPI property tags
Const PR_ACCOUNT = &H3A00001E ' alias
Const PR_GIVEN_NAME = &H3A06001E ' given name
Const PR_SURNAME = &H3A11001E ' surname
Const PR_TITLE = &H3A17001E ' title
Const PR_DISPLAY_NAME = &H3001001E ' display name

Set rdl = CreateObject("Redemption.SafeDistList")
rdl.Item = dl
count = rdl.MemberCount
MsgBox "count " & count
For i = 1 To count
Set rrecip = rdl.GetMember(i)
' is it an individual contact (not a DL)?
If rrecip.DisplayType = olUser Then
' is it an Exchange user?
Set rae = rrecip.AddressEntry
If rae.Type = "EX" Then
alias = rae.Fields(PR_ACCOUNT)
display = rae.Fields(PR_DISPLAY_NAME)
first = rae.Fields(PR_GIVEN_NAME)
last = rae.Fields(PR_SURNAME)
title = rae.Fields(PR_TITLE)
MsgBox "display " & display
End If
End If
Next

Set rae = Nothing
Set rdl = Nothing
Set rrecip = Nothing
End Sub

Your help is much appreciated. Thank u in advance.

-Kalyan



 




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
Outlook 2007 Redemption Expand Distribution List Kalyan Outlook - Using Contacts 1 November 5th 08 06:52 PM
Distribution list won't expand Baran3 Outlook - Using Contacts 0 September 26th 08 03:29 PM
can't expand distribution list jckelley Outlook - Using Contacts 5 May 9th 08 07:45 PM
No + to expand distribution list CArolyn Outlook - Using Contacts 5 March 11th 07 02:02 AM
Redemption library - Add distribution list as member to another distributionlist Tommy Ipsen Outlook - General Queries 0 June 2nd 06 10:23 PM


All times are GMT +1. The time now is 08:11 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.