We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub SaveToFolder(MyMail As MailItem) Dim strID As String Dim objNS As Outlook.NameSpace Dim objMail As Outlook.MailItem Dim objAtt As Outlook.Attachment Dim c As Integer Dim save_name As String 'Place path to sav to on next line. Note that you must include the 'final backslash Const save_path As String = "\\Network share\" strID = MyMail.EntryID Set objNS = Application.GetNamespace("MAPI") Set objMail = objNS.GetItemFromID(strID) If objMail.Attachments.Count > 0 Then For c = 1 To objMail.Attachments.Count Set objAtt = objMail.Attachments(c) save_name = Left(objAtt.FileName, Len(objAtt.FileName) - 5) save_name = save_name & Format(objMail.ReceivedTime, "_mm-dd-yyyy") save_name = save_name & Right(objAtt.FileName, 5) objAtt.SaveAsFile save_path & save_name Next End If Set objAtt = Nothing Set objMail = Nothing Set objNS = Nothing End Sub Sub Region1() End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.