S
Susan Lammi
This code is throwing a Type Mismatch error on the line "Set
mmsg=fldInItems(icnt)" but only if the previous message is moved. If none
of the messages are moved the code loops thru the entire collection
without issue.
What am I missing here.....??????
Note: fldInItems is a collection of Unread mail messages in the "InBox"
dim fldInItems as Items
dim mmsg as MailItem
Do Until icnt > fldInItems.Count
Set mmsg = fldInItems(icnt)
If InStr(1, mmsg.Subject, "!#Metrics#!") <> 0 And Not
IsNull(mmsg.Subject) Then
mmsg.Move fldMetrics
Else
icnt = icnt + 1
End If
Loop
mmsg=fldInItems(icnt)" but only if the previous message is moved. If none
of the messages are moved the code loops thru the entire collection
without issue.
What am I missing here.....??????
Note: fldInItems is a collection of Unread mail messages in the "InBox"
dim fldInItems as Items
dim mmsg as MailItem
Do Until icnt > fldInItems.Count
Set mmsg = fldInItems(icnt)
If InStr(1, mmsg.Subject, "!#Metrics#!") <> 0 And Not
IsNull(mmsg.Subject) Then
mmsg.Move fldMetrics
Else
icnt = icnt + 1
End If
Loop