Redemption: removing recipients from distribution lists?

  • Thread starter Thread starter Dieter Verlaeckt
  • Start date Start date
D

Dieter Verlaeckt

Hi,

I'm developing a COM add-in for Outlook using VC++ .NET 2003.

I have the following problem: when i try to remove all recipients from a
distribution list, for some reason the last recipient never gets removed.

I used the following code for removing the recipients:

long nMemberCount = spSafeDistributionList->GetMemberCount();

for (int i = nMemberCount; i > 0; --i)

{

spSafeDistributionList->RemoveMemberEx(i); <--- always returns S_OK, also
for the last recipient.

}

nMemberCount = spSafeDistributionList->GetMemberCount(); <--- returns 1,
the last recipient did not get removed from the list.


I have also used the same code but with the normal RemoveMember() function
instead of the RemoveMemberEx() function. The result is the same.

Why doesn't this work? is there a better method for removing the recipients
(i would prefer not to recreate the distribution list itself).

TIA

Dieter
 
Hmmm... I can reproduce that. Send an e-mail to my private address; I'll
send you an updated version.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top