Solved

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

Posted on 2014-09-11
4
626 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 48

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 48

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article will shed light on the latest trends when it comes to your resume building needs. For far too long, the traditional CV format has monopolized the recruitment market.
If you don't know how to downgrade, my instructions below should be helpful.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

743 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

11 Experts available now in Live!

Get 1:1 Help Now