How do I save Outlook attachments to folder (multiple file types)? pdf doc jpg

I found script for a module that would move all pdf attachments to a specific folder on my HD. I was wondering how to include jpg and doc fomats too?
Here is the code I used:
Sub SaveAttachmentsToDisk(Item As Outlook.MailItem)
    Dim olkFolder As Outlook.MAPIFolder, _
        olkAttachment As Outlook.Attachment, _
        objFSO As Object, _
        strRootFolderPath As String, _
        strFilename As String, _
        intCount As Integer
    'Change the path on the following line to the folder you want the attachments save in
    strRootFolderPath = "C:\eeTesting\Attachments\"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set olkFolder = Application.ActiveExplorer.CurrentFolder
    If Item.Attachments.Count > 0 Then
        For Each olkAttachment In Item.Attachments
            If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "pdf" Then
                strFilename = olkAttachment.FileName
                intCount = 0
                Do While True
                    If objFSO.FileExists(strRootFolderPath & strFilename) Then
                        intCount = intCount + 1
                        strFilename = "Copy (" & intCount & ") of " & olkAttachment.FileName
                        Exit Do
                    End If
                olkAttachment.SaveAsFile strRootFolderPath & strFilename
            End If
    End If
    Set objFSO = Nothing
    Set olkAttachment = Nothing
    Set olkFolder = Nothing
End Sub
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I assume you've tried changing the line:

     If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "pdf" Then

to be
     If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "pdf" or objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "jpg" or objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "doc" Then


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yesiamcAuthor Commented:
I did not! I will give it a try. thanks for the quick response.
yesiamcAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.