Solved

Mark items in deleted items and junk e-mail as read

Posted on 2014-09-11
4
642 Views
Last Modified: 2014-09-12
I'm expanding the question listed here on how to use the code, provided by BlueDevilFan, to apply to both folders, deleted items and junk e-mail. http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_28212656.html   

Dim WithEvents olkFld As Outlook.Items

Private Sub Application_Quit()
    Set olkFld = Nothing
End Sub

Private Sub Application_Startup()
    Set olkFld = Session.GetDefaultFolder(olFolderDeletedItems).Items
End Sub

Private Sub olkFld_ItemAdd(ByVal Item As Object)
    Item.UnRead = False
    Item.Save
End Sub
0
Comment
Question by:emeschke
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40318620
Hi,

Pls try

Dim WithEvents olkFld As Outlook.Items

Private Sub Application_Quit()
    Set olkFld = Nothing
    Set olkFldJunk = Nothing

End Sub

Private Sub Application_Startup()
    Set olkFld = Session.GetDefaultFolder(olFolderDeletedItems).Items
    Set olkFldJunk = Session.GetDefaultFolder(olFolderJunk).Items

End Sub

Private Sub olkFld_ItemAdd(ByVal Item As Object)
    Item.UnRead = False
    Item.Save
End Sub 

Private Sub olkFldJunk_ItemAdd(ByVal Item As Object)
    Item.UnRead = False
    Item.Save
End Sub 

Open in new window



Regards
0
 

Author Comment

by:emeschke
ID: 40319249
Rgonzo,

Thanks for the quick reply!  This script isn't working at the moment.  The deleted items are being marked as read, but not the junk e-mail.   Looking at the sections in the vbaproject i noticed that the part I've marked in the screen shot is marked as "general" and the section above it relating to the deleted items folder is marked as "olkFld".  I'm not sure if that is causing the problem or not but i though i would mention it.  I am using Outlook 2013.  

Thanks!
olkfld.PNG
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40319295
pls try

Dim WithEvents olkFld As Outlook.Items
Dim WithEvents olkFldJunk As Outlook.Items

Private Sub Application_Quit()
    Set olkFld = Nothing
    Set olkFldJunk = Nothing

End Sub

Private Sub Application_Startup()
    Set olkFld = Session.GetDefaultFolder(olFolderDeletedItems).Items
    Set olkFldJunk = Session.GetDefaultFolder(olFolderJunk).Items

End Sub

Private Sub olkFld_ItemAdd(ByVal Item As Object)
    Item.UnRead = False
    Item.Save
End Sub 

Private Sub olkFldJunk_ItemAdd(ByVal Item As Object)
    Item.UnRead = False
    Item.Save
End Sub 

Open in new window

0
 

Author Closing Comment

by:emeschke
ID: 40319313
The second solution worked!  Thanks for the help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now