The comment marks and strings are wrong:
'This is a comment
`Do Not need - not a comment
‘if we ever - not a comment
string1 = "ok"
string2 = “not ok”
The code looks like it was processed with a text beautifier, if you can't get the original you can fix it by replacing curly quotes with straight ones, either with search&replace (` -> ', ‘ -> ', “ -> ", ” -> ") or manually.
Your code:
...
If Not LCase$(docCur.Form(0)) = “nondelivery report” Then ‘Don’t bother For failed delivery reports
‘Only internet messages
‘ If docCur.hasitem(“SMTPOriginator”) Or docCur.hasitem(“MIME_Version”) Or docCur.hasitem(“$MIMETrack”) Then
If Not docCur.HasItem(“$AssistMail”) Then ‘isn’t sent by another agent
If IsMessageUnique(docCur) Then
...
Corrected:
...
If Not LCase$(docCur.Form(0)) = "nondelivery report" Then 'Don’t bother For failed delivery reports
'Only internet messages
' If docCur.hasitem(“SMTPOriginator”) Or docCur.hasitem(“MIME_Version”) Or docCur.hasitem("$MIMETrack") Then
If Not docCur.HasItem("$AssistMail") Then 'isn’t sent by another agent
If IsMessageUnique(docCur) Then
...