That's weird. It works fine here. What version of Outlook are you using? If you comment out the On Error Resume Next statement, do you get any errors?
I would like to leave the first recipient as well. However, when you
click "NO" it does not remove any recipients so the behavior is the
same as clicking "YES".
Thanks.
Sue Mosher [MVP-Outlook] wrote:
If you want to remove all recipients, the For statement would need to count to 1, not 2. I wanted to leave the first recipient in for myself.
The original recipients do not get removed when NO is clicked. Here's
the code:
If myResult = vbNo Then
' remove all recipients except the first one
count = msg.Recipients.count
For i = count To 2 Step -1
msg.Recipients.Remove i
Thanks.
Sue Mosher [MVP-Outlook] wrote:
Forgot to change one thing before I posted it. Change this statement:
If msg.Recipients.count > 0 Then
to
If msg.Recipients.count > 1 Then
Let me know if that works better. You could also use Recipient.Delete instead of Recipients.Remove but I felt lazy today (after watching about 8 inches of rain in 3 days).
I followed the instructions and used this code. However, if I click No
when prompted "do you want to reply to all", it still includes all
recipients in the message. I also get prompted even if I do a "reply"
and not "replyall".
Thanks.
Sue Mosher [MVP-Outlook] wrote:
What you're missing is the fact that at any given moment, the user could reply to any open message or any selected message. The code to keep track of all those messages and handle the ReplyAll event for ***every one of them*** is quite complicated.
But it's not so hard to determine whether a message is a reply to all. See
http://www.outlookcode.com/codedetail.aspx?id=1299 for a little VBA routine that uses the Inspectors.NewInspector event to prompt the user and then remove all but the first Recipient if the user doesn't want to Reply to All.
I want a warning to display when the "Reply to All" is clicked.