This is fairly simple with a script associated with a rule to identify the message sender (or to process all incoming messages) . The code assumes that the target folder exists and overwrites any existing file of the same name in the target folder.
Sub SaveAttachment(olItem As MailItem) 'An Outlook macro by Graham Mayor Dim olAttach As Attachment Dim strFname As String Dim j As Long Const strSaveFldr As String = "D:\Test\" 'folder must exist On Error GoTo lbl_Exit If olItem.Attachments.Count > 0 Then For j = 1 to olItem.Attachments.Count Set olAttach = olItem.Attachments(j) If UCase(olAttach.fileName) = "ABC.XLS" Then strFname = olAttach.fileName olAttach.SaveAsFile strSaveFldr & strFname Exit For End If Next j olItem.Save End If lbl_Exit: Set olAttach = Nothing Set olItem = Nothing Exit Sub End Sub




Reply With Quote