Hi there!

I work for a tour operator and I do basic office work/customer service work. There's this one task where I basically have to scan a form (hundreds of them but each file individually), e-mail them to my e-mail (with each e-mail is about 30 attachments), and then save them as individual .pdf's on my hard drive which then after I run through them and change the name corresponding to the name on the form.

So I wanted to create a macro that automatically saves all 30 or so attachments form each e-mail, and since they are all named something like DC001, I'd like to somehow save it as Form1, Form2, Form3, Form4, Form5, etc and have a counter integer in the macro to continuously save it as a different FormNumber.

The problem is: I'm not too great with Visual Basic (haven't programmed since high school!) and I am quite unfamiliar with this, I have a code that I'm trying to tweak and use at the bottom. For awhile I couldn't get the code to even recognize the attachments, but then finally it saved them all from one e-mail but it was named "Xerox Scanned Document" and it was an outlook file, because you have to double click the attachment to get it as a pdf file. I realize there is an option in Outlook that says "Save all attachments" but like previously it saved them all as one outlook file, here is a picture to kind of show what I mean:




Code:
Sub GetAttachments()
' This Outlook macro checks a the Outlook Inbox for messages
' with attached files (of any type) and saves them to disk.
' NOTE: make sure the specified save folder exists before
' running the macro.
    On Error GoTo GetAttachments_err
' Declare variables
    Dim ns As NameSpace
    Dim Inbox As MAPIFolder
    Dim SubFolder 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)
    Set SubFolder = Inbox.Folders("Parental Consent Forms")
    i = 0
' Check Inbox for messages and exit of none found
    If SubFolder.Items.Count = 0 Then
        MsgBox "There are no messages in the Parental Consent Forms Folder.", vbInformation, _
               "Nothing Found"
        Exit Sub
    End If
' Check each message for attachments
    For Each Item In SubFolder.Items
' Save any attachments found
        For Each Atmt In Item.Attachments
        ' This path must exist! Change folder name as necessary.
            FileName = "C:\Documents and Settings\npasmore\My Documents\Parental Consent Forms\" & Atmt.FileName
            Atmt.SaveAsFile FileName
            i = i + 1
         Next Atmt
    Next Item
' Show summary message
    If i > 0 Then
        MsgBox "I found " & i & " attached files." _
        & vbCrLf & "I have saved them into the C:\Documents and Settings\npasmore\My Documents\Parental Consent Forms." _
        & vbCrLf & vbCrLf & "Have a nice day.", vbInformation, "Finished!"
    Else
        MsgBox "I didn't find any attached files in your mail.", vbInformation, "Finished!"
    End If
' Clear memory
GetAttachments_exit:
    Set Atmt = Nothing
    Set Item = Nothing
    Set ns = Nothing
    Exit Sub
' Handle errors
GetAttachments_err:
    MsgBox "An unexpected error has occurred." _
        & vbCrLf & "Please note and report the following information." _
        & vbCrLf & "Macro Name: GetAttachments" _
        & vbCrLf & "Error Number: " & Err.Number _
        & vbCrLf & "Error Description: " & Err.Description _
        , vbCritical, "Error!"
    Resume GetAttachments_exit
End Sub
I would be greatly appreciative if someone could help as this is a long and strenuous task which takes hours but with the right macro - could take maybe half an hour.