Am trying to write a script to copy email with certain attachment types.
New to VBA for outlook, and running into an issue.
I get an error (Error: (13) Type mismatch) on the line:
"myATT = Item.Attachments"
What am I doing incorrectly?
Public Sub MoveMNS1(Item As Outlook.MailItem)
On Error GoTo PROC_ERR
Dim myAtt As Outlook.Attachment
myAtt = Item.Attachments
If Right(LCase(myAtt.FileName), 4) = ".msg" Then
Item.Copy Session.GetDefaultFolder("MNS")
End If
PROC_ERR:
MsgBox "Error: (" & Err.Number & ") " & Err.Description, vbCritical
Debug.Print "Error: (" & Err.Number & ") " & Err.Description
End Sub
Thanks for your help.