Quote Originally Posted by gmayor View Post
Assuming the 'generic text' doesn't include any numbers then

Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)

Dim oAttachment As Outlook.Attachment
Dim sName As String
Const sSaveFolder As String = "P:\OUTLOOKDUMP\"
    For Each oAttachment In MItem.Attachments
        If Right(LCase(oAttachment.fileName), 3) = "pdf" Then
            sName = GetNum(oAttachment.fileName) & ".pdf"
            oAttachment.SaveAsFile sSaveFolder & sName
        End If
    Next
End Sub

Private Function GetNum(sText As String) As String
Dim i As Integer
    For i = 1 To Len(sText)
        If Mid(sText, i, 1) >= "0" And Mid(sText, i, 1) <= "9" Then
            GetNum = GetNum + Mid(sText, i, 1)
        End If
    Next
lbl_Exit:
    Exit Function
End Function
Dude... seriously amazing! Thank you!

one thing that i forgot about, and I do not know if there is a way to resolve in the renaming convention.

There are times where at the end of the numbers, and right before the ".pdf" that the final character is an "X". Is there a way to make it so that it does not strip the X??