Selective read receipt Part 2

P

prideoflions

Hello,

Background: This is a followup question to Selective Read Receipts VBA using
run script rule. I wish to set my tracking option to always allow read
receipts, but on every incoming message from someone not in my address book
(set using filters) a script runs allowing me to chose whether to allow the
receipt or not.

Problem: I think there is something wrong in the approach I'm taking to
remove the read receipt from selective addresses. The following code runs and
I've stepped through it using break points and the display comes up, it moves
into the vbno section with a No selection and it steps through the
read.receipt = false portion, but the read receipt goes out as a positive
when read anyway. For some reason the read receipt property either doesn't
change, doesn't stay changed or something.

Thanks!

My 'working' code is as follows:

Sub Test(MyMail As Outlook.MailItem)
Dim strID As String
Dim Display As String
Dim Title As String
Dim olNS As Outlook.NameSpace
Dim Item As Outlook.MailItem
Dim Response As VbMsgBoxResult
Dim Style As VbMsgBoxStyle

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set Item = olNS.GetItemFromID(strID)

Display = "Do you wish to allow a read receipt from " &
Item.SenderEmailAddress & "?"
Style = vbYesNo
Title = "Read Receipt Prompt" ' Define title.

If Item.ReadReceiptRequested = True Then
Response = MsgBox(Display, Style, Title)
If Response = vbNo Then
Item.ReadReceiptRequested = False
Item.Save
End If
End If

Set Item = Nothing
Set olNS = Nothing

End Sub
 
P

prideoflions

I've reviewed that thread a number of times, but it's for O2K not 2003. Also
it doesn't run from the "run a script" option in a filter so alot of it is
really different and extemly hard for me to extricate the portions that apply
to what I need. I'm pretty novice at this and the whole CDO thing is a little
over my head. The last comment by Ken slovak seems to have merit, but as
there is no revised code, I'm not sure how to encorporate it.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top