Sub MoveMail(Item As Outlook.MailItem) If Item.Attachments.Count > 0 Then Dim attCount As Long Dim strFile As String Dim sFileType As String attCount = Item.Attachments.Count For i = attCount To 1 Step -1 strFile = Item.Attachments.Item(i).FileName sFileType = LCase$(Right$(strFile, 4)) Select Case sFileType Case ".csv", ".xls", "xlsx" Item.Move (Session.GetDefaultFolder(olFolderInbox).Folders("Move")) GoTo endsub End Select Next i End If endsub: Set Item = Nothing End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)