V
V
Vakov2018-09-05 21:25:02
Email
Vakov, 2018-09-05 21:25:02

How do I set Outlook 2016 to automatically save incoming message attachments to disk?

How do I set Outlook 2016 to automatically save incoming message attachments to disk? Googled "Attachments Processor for Outlook" - but it's a paid solution. Is there an alternative? You want to automatically download an attachment as soon as an incoming message contains an attachment.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bcoon, 2018-09-05
@Volunteer

You need a macro and a corresponding rule. Add a new module to the project and put the code there

Public Sub saveAtt (itm As Outlook.MailItem)

Dim objAtt As Outlook.Attachment 'переменная для работы с вложениями
Dim saveFolder As String 'переменная для пути к папке сохранения
Dim sDateMail as string 'переманная для даты письма
'сохраняем в правильном формате время создания сообщения
sDateMail = Format(itm.CreationTime, "hh-mm-ss_dd.mm.yyyy")

'задаем путь к папке сохранения
saveFolder = "C:\Users\Username\Desktop\"
'перебираем все вложения в письме
For each objAtt in itm.Attachments
'сохраняем вложение в папку под именем: дата письма + название файла вложения
objAtt.SaveAsFile saveFolder & "\" & sDateMail & "_" & objAtt.FileName
'очищаем переменную с вложением
Set objAtt = Nothing
Next objAtt

End Sub

Next, create a rule. Set the condition for letters and select the option " Run script ". There, in the list of scripts, select the name of the created macro.
And then select: " Developer " - " Macro Security " - " Macro Options " - " Enable all macros ".
There is no built-in method in the program

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question