Code: Select all
For Each objItm In objItms
If objItm.Attachments.Count > 0 Then
For Each objAtt In objItm.Attachments
If objAtt.Filename = "ZIP.zip" Then
TEST_DATA = "ASSMF-" & Format$(objItm.ReceivedTime, "DDMMYYYY-HHNNSS") & ".txt"
SQL = "SELECT DATA_CONT FROM DATE_CONT WHERE DATA_CONT='" & TEST_DATA & "'"
Set RS = CONN.Execute(SQL)
If RS.EOF Then
objAtt.SaveAsFile "C:\ASS\ZIP.zip"
Application.Wait Now + TimeValue("00:00:02")
UN_ZIP TEST_DATA
CurrentCol = CurrentCol + 1
End If
End If
Next objAtt
End If
objItm.Delete
Next objItm
1) the next loop find all items but not the last... perpahs because during the next for, delete the single item founded???
in othe code to correct this prob i use a step -1 in the TO option but i not have idea to insert this tips in the:
For Each objItm In objItms
2) i see the cdoe loop in the items attachment with a For Each objAtt In objItm.Attachments ...next, but i have only one attachment into the sigle item and not more...
is possible to dlete this next loop toi check if the item contain more one attachment?
note:
This is a cut & paste from suggestion code of Hans