Hi @Veronica Tufi
Welcome to our forum!
Here is a guide to help you set this up:
- Open Outlook and Access VBA Editor: Press Alt + F11 to open the Microsoft Visual Basic for Applications (VBA) editor.
- Insert a New Module: In the VBA editor, go to Insert > Module to create a new module.
Copy and Paste the VBA Script: Copy the following VBA script and paste it into the new module window:
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "\\YourNetworkPath\YourFolder\" ' Replace with your network path
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub
Replace \\YourNetworkPath\YourFolder\
with the actual network path where you want to save the attachments.
- Set Up an Outlook Rule: After creating the VBA script, you need to set up an Outlook rule to run the script automatically:
- Go to Home > Rules > Manage Rules & Alerts.
- Click on New Rule and select Apply rule on messages I receive.
- Choose the conditions for the rule (e.g., from a specific sender or with specific words in the subject).
- In the Select action(s) step, choose run a script and select the SaveAttachmentsToDisk script you created.
- Complete the rule setup by following the prompts.
- Save and Test: Save the VBA script and the rule. Send a test email with an attachment to see if it is automatically saved to the specified network path.
This script will save all attachments from incoming emails to the specified network path. If you need to save the entire email message, you can modify the script accordingly.
Hope it helps!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our [documentation] to enable e-mail notifications if you want to receive the related email notification for this thread.