PDA

View Full Version : Help on Outlook Attachment Prompt to save which folder



maga
07-18-2023, 08:45 PM
Hi there!

Any coders know what syntax to input for the sSaveFolder folder location so that every time when creating a new rule through Rule Wizard it will prompt which local folder location you want to save to? Instead of creating multiple modules for to be save in different folders.

Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "C:\Users\Profile 1\Downloads\Testing"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub

Thanks in advance!

June7
07-18-2023, 10:48 PM
Open File System Object file picker dialog. This is a common topic. Here is one reference https://stackoverflow.com/questions/25087412/vba-selecting-a-folder-and-referencing-it-as-the-path-for-a-separate-code