>> DistListItem.Members

  • Thread starter Thread starter Jonathan Parminter
  • Start date Start date
J

Jonathan Parminter

Hi, I'm using vb script behind an appointment item. The
intention is to check that the user of the form is a
member of a particular group. The code triggers an error
for both the .MemberCount and .Member properties.

What do I need to change in order for the following scrip
to run?

**** code start ****

set objDistListItem = objAddresseEntries.Item("Is
Group")

if fOK then
fOK=false
intIndex = 1
do until intindex >
objDistListItem.MemberCount _
or fOK = true

set objMember =
objDistListItem.Member(intIndex)

msgbox "Group Member: " &
objMember.Name

if lcase(objMember.Name)= _
lcase
(objNS.CurrentUser.Name) then
fOK=TRUE
end if
intIndex = intIndex + 1
loop
end if

**** code end ****

Any ideas or recommendations appreciated :-)

Thanks
Jonathan
 
Hi Jonathan,
set objDistListItem = objAddresseEntries.Item("Is
Group")

this returns an AddressEntry-Object which offers for Distlists an
AddressEntries-Collection called Members.

So the Methods you are looking for are
- Members.Count
- Members.Item(intIndex) or Members(intIndex)
if lcase(objMember.Name)= _
lcase
(objNS.CurrentUser.Name) then

Because objMember.Name often ends with "(E-Mail)" you need to use:
if objMember.Name like CurrentUser.Name & "*"

Anyway, it is unambiguous if you use the Address- instead of the
Name-Property.
 
Back
Top