Really should post the object variable declaration and set lines as well.
Here is my procedure that worked:
Code:
Sub SaveEmailAtt()
Dim objNS As Outlook.NameSpace: Set objNS = GetNamespace("MAPI")
Dim olFolder As Outlook.MAPIFolder: Set olFolder = objNS.GetDefaultFolder(olFolderInbox)
Dim objAttachments As Outlook.Attachments
Dim oMail As Outlook.MailItem
Dim Item As Object
Dim lngCount As Long, i As Integer
For Each Item In olFolder.Items
If TypeOf Item Is Outlook.MailItem Then
Set oMail = Item
Set objAttachments = oMail.Attachments
lngCount = objAttachments.Count
If lngCount > 0 Then
' We need to use a count down loop for removing items
' from a collection. Otherwise, the loop counter gets
' confused and only every other item is removed.
For i = lngCount To 1 Step -1
objAttachments.Item(i).SaveAsFile "C:\Users\June\Forums\" & objAttachments.Item(i).FileName
Next i
End If
End If
Next
End Sub