I took over this process from someone that scans the INBOX in my Outlook and picks up certain email and puts them into a Log. For a while it worked, now I got this error, not sure why all of a sudden I am getting the error, it is:
" Run-time error '-2147352567 (80020009)':
Array index out of bounds. "
and idea ?
When I step through this code, the error pops up at the line:
Set myinboxfolder = myInbox.Folders(3)
Thanks!
Sub ExportAll()
' copies every messages from the IN Box
Dim Message As MailItem
Set myNameSpace = Application.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myinboxfolder = myInbox.Folders(3)
For Each Message In myinboxfolder.Items
Message.Categories = "Job"
Message.Save
Next Message
End Sub
" Run-time error '-2147352567 (80020009)':
Array index out of bounds. "
and idea ?
When I step through this code, the error pops up at the line:
Set myinboxfolder = myInbox.Folders(3)
Thanks!
Sub ExportAll()
' copies every messages from the IN Box
Dim Message As MailItem
Set myNameSpace = Application.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myinboxfolder = myInbox.Folders(3)
For Each Message In myinboxfolder.Items
Message.Categories = "Job"
Message.Save
Next Message
End Sub