travelnitwit
Technical User
I have this script to auto save attachments from outlook in a folder but it only saves attachments from 2 emails at a time. How do I increase this to 3 or 4?
Code:
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objMailbox = objNamespace.Folders("Mailbox - ABC")
Set objFolder = objMailbox.Folders("Inbox")
Set colItems = objFolder.Items
Set colFilteredItems = colItems.Restrict("[UnRead] = True")
For Each objMessage in colFilteredItems
intCount = objMessage.Attachments.Count
If intCount > 0 Then
For i = 1 To intCount
objMessage.Attachments.Item(i).SaveAsFile "C:\" & _
objMessage.Attachments.Item(i).FileName
Next
End If
objMessage.Unread = False
Next