PDA

View Full Version : Attachment Download VBA



moni_tm
07-11-2017, 09:35 AM
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

gmayor
07-11-2017, 08:10 PM
See http://www.vbaexpress.com/forum/showthread.php?59969-VBA-Help-Add-quot-Save-attachment-as-subject-quot-into-script