Hi,

I am hoping to get some help with an outlook macro. I am somewhat similar with excel however, my vba skills with outlook are extremely lacking.

I'm in need of a macro that saves and renames the attachments of an email based on the sender.

So for example, Bob will send me an email with 3 excel files. Expense Report.xls, Sales Report.xls, and Cusotmer PO report.xls

What I would like is a macro that can determine that the email is from [email protected] and save only 2 of the excel attachemnts in a specified folder with the format of Bob_Expense_Report and Bob_Sales_Report. (I don't want the customer po report saved)

So far I have worked out this much but I'm not having much luck getting any further. Hopefully someone can help me out further. Thanks in advance.


Public Sub SaveAttachmenttoDisk()

Dim saveFolder As String
Dim objAtt As Outlook.Attachment
Dim itm As Outlook.MailItem
Dim sales As String

saveFolder = "C:\Users\60047384\Documents\Current Inventory Report\Rack Reports\"
sales = Format("BOB_")
For Each itm In ActiveExplorer.Selection
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & sales & objAtt.DisplayName
Set objAtt = Nothing
Next objAtt
Next itm

End Sub