PDA

View Full Version : [SOLVED:] Edit VBA to mark original email as read in Outlook 2010



MR_Nura
05-14-2018, 04:20 AM
Hi,
i recently created some VBA's to either 'Reply All' or to or 'Forward' emails and adding the word "Restricted" at the beginning of the subject. the VBA work OK for that, however it is marking the mail as read in the viewing pane but not the inbox number of unread emails? could someone help me with the below VBA's to adjust this? I have attached an example of how i want it to look.

VBA 1 for Replying all to emails

Public Sub SecureReply()
Dim objApp As Outlook.Application
Dim objItem As MailItem
Dim strSecure As String


Set objApp = Application
Set objItem = objApp.ActiveExplorer.Selection.Item(1)
Set Item = objItem.ReplyAll

strSecure = "RESTRICTED " & Item.Subject
Item.Subject = strSecure
Item.Display
End Sub

VBA 2 for Forwarding emails

Public Sub SecureForward()
Dim objApp As Outlook.Application
Dim objItem As MailItem
Dim strSecure As String


Set objApp = Application
Set objItem = objApp.ActiveExplorer.Selection.Item(1)
Set Item = objItem.Forward

strSecure = "RESTRICTED " & Item.Subject
Item.Subject = strSecure
Item.Display
End Sub


Many thanks in advance for anyones help!

skatonni
05-14-2018, 01:54 PM
objItem.unread = false

skatonni
05-14-2018, 02:17 PM
Site glitch? Answer to another question posted in wrong thread.

MR_Nura
05-15-2018, 12:40 AM
Amazing, thanks so much. I spent ages looking online for an additional code. Very much appreciated :)