Why does my code cause Deleted Without Being Read Receipt?

M

Maike13

I wrote some Outlook VBA code so that when a message is added to the Inbox,
it creates a new folder named with the sender's name and moves the new
message into that folder. The code works fine except that, if the sender has
requested a read receipt, they get a "Your message was deleted without being
read" message, although the message wasn't deleted, just moved into a new
folder. What's the problem and how can I fix it?
Oh, one other thing, in case it's relevant. I'm using Redemption to prevent
security warnings when I access the Sender name.
Here's my code:

Public WithEvents myOlItems As Outlook.Items


Public Sub Application_Startup()
Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
End Sub


Private Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim myFolder As Outlook.MAPIFolder
Dim myNewFolder As Outlook.MAPIFolder
Dim sItem
Set sItem = CreateObject("myOWNdllNAME.SafeMailItem") 'The Redmption DLL
- "Not my real one of course :)
sItem.AuthKey = "myOWNkey" 'My Redemption security key - "Also not real"
sItem.Item = Item
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
On Error GoTo existingFolder
Set myNewFolder = myInbox.Folders.Add(sItem.SenderName)
GoTo skipNameFolder
existingFolder:
Set myNewFolder = myInbox.Folders(sItem.SenderName)
skipNameFolder:
On Error GoTo 0
sItem.Move myNewFolder
End Sub
 
M

Maike13

Well I still don't know why it does this but I did find a work around. I
added the following code after:
sItem.Item = Item

If sItem.Item.UnRead = True then 'If mail message is unread
sItem.Item.UnRead = False 'Mark it as read.
'This causes a correct
'"Your message was read"
'receipt to be sent
sItem.Item.UnRead = True 'Mark message as unread
End If

Also, sorry for the multiple postings of my original question. It gave me a
post failed message twice and then went ahead and posted it anyway. Next
time I'll wait and make sure it really doesn't post before re-posting.
 
O

OneClassicDude

I know this is an old subject, and you found a workaround, but I wa
researching something else and I ran across this. Thought it would b
good to get the information out there for the future:

Outlook 2002 does not prompt you to send a receipt for deleted e-mail.

When you empty your Deleted Items folder, any POP mail account message
that have a Read receipt sends a Not Read receipt without prompting yo
to approve sending the receipt. This issue does not occur if you clic
to clear the Remove from server when deleted from 'Deleted Items' chec
box
 

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