Error with "Item.UnRead = False" for encrypted messages

M

M. Brown

The macro below works in conjunction with a rule that copies each email I
send in a specific personal folder. As soon as the email copy is placed in
the personal folder, the macro below sets UnRead = False on the email copy.
This works great until I send an encrypted email. The rule copies the
encrypted email to the correct personal folder but the macro fails at
"Item.UnRead = False". I get a message that says "Run-time error
'-2147217660 (80040F04)':" / "Method 'UnRead' of object 'MailItem' failed.

Thanks in advance for any tips you can provide!

----------------------------------
Public WithEvents myOlItems2 As Outlook.Items

Public Sub Application_Startup()
Set myOlItems2 = Outlook.Session.Folders("Personal
Folders").Folders("Inbox").Folders("Sent (2007)").Items
End Sub

Public Sub myOlItems2_ItemAdd(ByVal Item As Object)

Dim myOlAppSub As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim mySentFolder As Outlook.MAPIFolder

Set myOlAppSub = CreateObject("Outlook.Application")
Set myNameSpace = myOlAppSub.GetNamespace("MAPI")
Set mySentFolder = myNameSpace.Folders("Personal
Folders").Folders("Inbox").Folders("Sent (2007)")

Item.UnRead = False
End Sub
 

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