Avatar of Ryan Rood
Ryan Rood
Flag for Canada asked on

Outlook VBA Addin

I found this code snippet on another site: https://www.extendoffice.com/documents/outlook/3747-outlook-auto-download-save-attachments-to-folder.html

This works! Which is great. However I would like to modify this to only grab PDF files from the emails and prepend a date to the file name (yyyymmdd - original filename). I have zero programming knowledge. I have found a few different sites and have tried to modify but it just breaks the code and the script stops working. Any assistance would be appreciated.

Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub
ProgrammingOutlookVBA

Avatar of undefined
Last Comment
Ryan Rood

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rgonzo1971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ryan Rood

ASKER
Thank you so much! That is exactly what I needed! :)
Your help has saved me hundreds of hours of internet surfing.
fblack61