Currently, I have the following code and rule set up working, which automatically pulls attachments from incoming emails and saves them to a shared drive in Outlook 2010. This also is pulling in signatures, etc, of which I do not need. I solely need ".pdf" files to be extracted from emails and saved to the shared folder. I know I am missing a simple line of code in order to accomplish this, but after several attempts, I think I may keep finding the right "IF" statement, but I can't seem to figure out what it is or where to put it.

Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer

Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
i = 0

For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
FileName = "\\Invoices for Processing" & _
Format(Item.CreationTime, "yyyymmdd_hhmmss_") & Atmt.FileName
Atmt.SaveAsFile FileName
i = i + 1
Next Atmt
Next Item


End Sub

Any help would be greatly appreciated. Thanks.