Hello,

I need to save attachments to disk from the Inbox for all emails with a specific word in subsject - using a outllok rule.

Because the files attached in the emails have the same name in all emails, I need to change the file saved name to, for example, the sender name or the email send date & time.

I'm using the code:
----------------
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)

Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim dateFormat As String

saveFolder = "D:\Audiologista\Lucia@AM\Tee\Rules Outlook\" 'destination folder
dateFormat = Format(Now, "yyyy-mm-dd HH.mm")

For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & dateFormat & "_" & objAtt.DisplayName
Set objAtt = Nothing
Next

End Sub
------------------

How can I change the name of the file to have the send email date or the email send name?

Many thanks


LL