I have the following code to save the attachments from the selected email message in Outlook. After the macro runs I need the message to be marked as read. What do I need to add to the code so after running the message is marked as read? Thank you.
Troy
'-------------------------------
Public Sub SaveAttachments()
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim itm As Object
Set myOlExp = Application.ActiveExplorer
Set myOlSel = myOlExp.Selection
saveFolder = "S:\BHSTE\Safety Management\AHSP\DUI 2.0\Incoming\"
On Error Resume Next
If myOlSel.Count > 0 Then
For Each itm In myOlSel
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
Set itm = Nothing
Next
End If
Set myOlExp = Nothing
Set myOlSel = Nothing
MsgBox "Attachments Saved.", vbInformation, "Complete"
End Sub
'-------------------------------


Reply With Quote