Solved

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

Posted on 2014-09-11
4
704 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 51

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 51

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

Office 365 Training for IT Pros

Learn how to provision Office 365 tenants, synchronize your on-premise Active Directory, and implement Single Sign-On.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Read this checklist to learn more about the 15 things you should never include in an email signature.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

737 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