Results 1 to 2 of 2

Thread: mark as read

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    1

    mark as read

    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
    '-------------------------------

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178

    Re: mark as read

    MailItem has an UnRead property.
    Regards
    BrianB
    -------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width