Discussion:
Get Exchange contact email address from PAB DL - VBA(VBScript)
(too old to reply)
Kalyan
2009-08-20 15:54:01 UTC
Permalink
Hi,
I'm trying to get the email address of an exchange contact added to PAB
DL.(in vbsript webapplication client code)
Environment: VBScript(Webapplication), Outlook 2003, IE7
Following is what required.
1. Add a exchange contact to PAB contact list.
2. Create a PAB distribution list(DL) and select the contact created
above(step 1) as member of this DL.
3. Expand DL and read the display Name and email address for each contact.
'''''''''Code snippet starts'''''''''''''''''''''''''''
set dlEntries = DLEntry.Members
dlCount = dlEntries.Count
for dlIndx = 1 to dlCount
if dlEntries(dlIndx).DisplayType = 1 Or
dlEntries.item(dlIndx).DisplayType = 5 then
EnumerateDL2003 dlEntries(dlIndx), mode
elseif dlEntries.item(dlIndx).DisplayType = 0 And
dlEntries.item(dlIndx).Type = "SMTP" then
email1 = dlEntries.item(dlIndx).Address
dispName = dlEntries.item(dlIndx).Name
else
email1 = dlEntries(dlIndx).Fields(&H39FE001F)
email2 = dlEntries(dlIndx).Address
dispName = dlEntries(dlIndx).Name
end if
'''''''''Code snippet ends'''''''''''''''''''''''''''

In the else part above I'm trying to read the contact(step 1) email address.
both email1 doesn't gives a value and email2 gives in x400 format like
/o=ML/ou=Second Administrative Group/cn=Recipients/cn=thomas
Other contact types are working fine with this in extracting name and emailid

Could anybody help on this?
Dmitry Streblechenko
2009-08-25 06:03:57 UTC
Permalink
Is that Redemption code? If yes, have you tried to read teh
AddressEntry.SmtpAddress property?
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Kalyan
Hi,
I'm trying to get the email address of an exchange contact added to PAB
DL.(in vbsript webapplication client code)
Environment: VBScript(Webapplication), Outlook 2003, IE7
Following is what required.
1. Add a exchange contact to PAB contact list.
2. Create a PAB distribution list(DL) and select the contact created
above(step 1) as member of this DL.
3. Expand DL and read the display Name and email address for each contact.
'''''''''Code snippet starts'''''''''''''''''''''''''''
set dlEntries = DLEntry.Members
dlCount = dlEntries.Count
for dlIndx = 1 to dlCount
if dlEntries(dlIndx).DisplayType = 1 Or
dlEntries.item(dlIndx).DisplayType = 5 then
EnumerateDL2003 dlEntries(dlIndx), mode
elseif dlEntries.item(dlIndx).DisplayType = 0 And
dlEntries.item(dlIndx).Type = "SMTP" then
email1 = dlEntries.item(dlIndx).Address
dispName = dlEntries.item(dlIndx).Name
else
email1 = dlEntries(dlIndx).Fields(&H39FE001F)
email2 = dlEntries(dlIndx).Address
dispName = dlEntries(dlIndx).Name
end if
'''''''''Code snippet ends'''''''''''''''''''''''''''
In the else part above I'm trying to read the contact(step 1) email address.
both email1 doesn't gives a value and email2 gives in x400 format like
/o=ML/ou=Second Administrative Group/cn=Recipients/cn=thomas
Other contact types are working fine with this in extracting name and emailid
Could anybody help on this?
Kalyan
2009-08-25 15:39:01 UTC
Permalink
Redemption part is working fine. The code I'm trying with Outlook Object
model/MAPI(Outlook 2003 & 2007). Could you pls help?
Post by Dmitry Streblechenko
Is that Redemption code? If yes, have you tried to read teh
AddressEntry.SmtpAddress property?
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Kalyan
Hi,
I'm trying to get the email address of an exchange contact added to PAB
DL.(in vbsript webapplication client code)
Environment: VBScript(Webapplication), Outlook 2003, IE7
Following is what required.
1. Add a exchange contact to PAB contact list.
2. Create a PAB distribution list(DL) and select the contact created
above(step 1) as member of this DL.
3. Expand DL and read the display Name and email address for each contact.
'''''''''Code snippet starts'''''''''''''''''''''''''''
set dlEntries = DLEntry.Members
dlCount = dlEntries.Count
for dlIndx = 1 to dlCount
if dlEntries(dlIndx).DisplayType = 1 Or
dlEntries.item(dlIndx).DisplayType = 5 then
EnumerateDL2003 dlEntries(dlIndx), mode
elseif dlEntries.item(dlIndx).DisplayType = 0 And
dlEntries.item(dlIndx).Type = "SMTP" then
email1 = dlEntries.item(dlIndx).Address
dispName = dlEntries.item(dlIndx).Name
else
email1 = dlEntries(dlIndx).Fields(&H39FE001F)
email2 = dlEntries(dlIndx).Address
dispName = dlEntries(dlIndx).Name
end if
'''''''''Code snippet ends'''''''''''''''''''''''''''
In the else part above I'm trying to read the contact(step 1) email address.
both email1 doesn't gives a value and email2 gives in x400 format like
/o=ML/ou=Second Administrative Group/cn=Recipients/cn=thomas
Other contact types are working fine with this in extracting name and emailid
Could anybody help on this?
Dmitry Streblechenko
2009-08-26 15:09:14 UTC
Permalink
I don't see any OOM code there. Even without seeing the vaariable
declarations, none of Outlook objects expose Fields().
Instead of using RDODistListItem.Members, use RDODistListItem.OneOffMembers.
Or, as I have alreday mentioned, use the AddressEntry.SmtpAddress property.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Kalyan
Redemption part is working fine. The code I'm trying with Outlook Object
model/MAPI(Outlook 2003 & 2007). Could you pls help?
Post by Dmitry Streblechenko
Is that Redemption code? If yes, have you tried to read teh
AddressEntry.SmtpAddress property?
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by Kalyan
Hi,
I'm trying to get the email address of an exchange contact added to PAB
DL.(in vbsript webapplication client code)
Environment: VBScript(Webapplication), Outlook 2003, IE7
Following is what required.
1. Add a exchange contact to PAB contact list.
2. Create a PAB distribution list(DL) and select the contact created
above(step 1) as member of this DL.
3. Expand DL and read the display Name and email address for each contact.
'''''''''Code snippet starts'''''''''''''''''''''''''''
set dlEntries = DLEntry.Members
dlCount = dlEntries.Count
for dlIndx = 1 to dlCount
if dlEntries(dlIndx).DisplayType = 1 Or
dlEntries.item(dlIndx).DisplayType = 5 then
EnumerateDL2003 dlEntries(dlIndx), mode
elseif dlEntries.item(dlIndx).DisplayType = 0 And
dlEntries.item(dlIndx).Type = "SMTP" then
email1 = dlEntries.item(dlIndx).Address
dispName = dlEntries.item(dlIndx).Name
else
email1 = dlEntries(dlIndx).Fields(&H39FE001F)
email2 = dlEntries(dlIndx).Address
dispName = dlEntries(dlIndx).Name
end if
'''''''''Code snippet ends'''''''''''''''''''''''''''
In the else part above I'm trying to read the contact(step 1) email address.
both email1 doesn't gives a value and email2 gives in x400 format like
/o=ML/ou=Second Administrative Group/cn=Recipients/cn=thomas
Other contact types are working fine with this in extracting name and emailid
Could anybody help on this?
Loading...