?
Solved

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

Posted on 2014-09-11
4
Medium Priority
?
738 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 52

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 52

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
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 …
Suggested Courses

752 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