A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 20th 07, 06:56 PM posted to microsoft.public.outlook.program_vba
M. Brown
external usenet poster
 
Posts: 1
Default Error with "Item.UnRead = False" for encrypted messages

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
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Could not open item. Try again" error message when adding a category to a mail Ambroise Nève Outlook - General Queries 6 November 28th 07 06:08 PM
Outlook 2007 recurring appointment error "Cannot open this item" Kat Barnes Outlook - Calandaring 0 October 22nd 07 10:42 PM
"Unread Messages" in Outlook 2007 Truewarrior Outlook - Installation 2 May 23rd 07 08:18 PM
I get a false "Windows - No Disk" error. Fix? DET Outlook - Installation 10 January 12th 07 06:19 PM
Restor "Unread Messages" folder! Noel All Outlook - Installation 1 March 20th 06 01:15 PM


All times are GMT +1. The time now is 11:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.