Solved

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

Posted on 2014-09-11
4
683 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 50

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 50

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you don't know how to downgrade, my instructions below should be helpful.
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.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
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…

830 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