Braunschweiger
Board Regular
- Joined
- Feb 19, 2014
- Messages
- 104
I would like...anytime I send an email to the "Deleted Items" folder it's marked as "read". The code below works for my default mailbox (work account) but...does not work for other mailboxes I have linked to Outlook (my Hotmail account).
Is there a modification of the script above that would work and apply to all linked email accounts in Outlook?
I'm use Office 365 and the Outlook software is on my laptop...not going out onto the net to check email.
Thank you in advance!
Code:
[COLOR=#000000][FONT=Courier]Dim WithEvents olkFld As Outlook.Items[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]Private Sub Application_Quit()[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier] Set olkFld = Nothing[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]End Sub[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]Private Sub Application_Startup()[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier] Set olkFld = Session.GetDefaultFolder(olFolderDeletedItems).Items[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]End Sub[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]Private Sub olkFld_ItemAdd(ByVal Item As Object)[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier] Item.UnRead = False[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier] Item.Save[/FONT][/COLOR][COLOR=#000000][FONT=Courier][/FONT][/COLOR][COLOR=#000000][FONT=Courier]End Sub[/FONT][/COLOR]
Is there a modification of the script above that would work and apply to all linked email accounts in Outlook?
I'm use Office 365 and the Outlook software is on my laptop...not going out onto the net to check email.
Thank you in advance!
Last edited: