Consulting

Results 1 to 2 of 2

Thread: Attachment Download VBA

  1. #1
    VBAX Newbie
    Joined
    Jul 2017
    Posts
    4
    Location

    Attachment Download VBA

    Good Afternoon,

    I have a my outlook setup to download files to a specific location if they are a PDF. Is it possible to update the script to rename the attachment to the subject line and date it was received?

    This is what I currently have.

    Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
    Dim oAttachment As Outlook.Attachment
    Dim sSaveFolder As String
    sSaveFolder = "C:\Users\tmona623\Desktop\Cash Dec\AutoDownload\"
    For Each oAttachment In MItem.Attachments
        If UCase(Right(oAttachment.FileName, 3)) = "PDF" Then _
            oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
    Next
    End Sub
    Thank you for any help

    Tom

  2. #2
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

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