N
noone
Hello all,
The code below works fine with one message selected,
however, it crashes when multiple ones are selected with
the above runtime error.
The crash occurs between the ========= lines
But I think it is because of this line:
Set myForward = oExp.Selection.Item(1).Forward
Any ideas ?
Dim oExp As Outlook.Explorer
Set oExp = Outlook.ActiveExplorer
Set objSelection = oExp.Selection
If objSelection.Count > 0 Then
For Each objItem In objSelection
If TypeOf objItem Is MailItem Then
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set myForward = oExp.Selection.Item(1).Forward
SafeItem.Item = myForward
=======================================
With SafeItem
.Recipients.Add "#Unsolicited Email"
.Body = "Forwarded via Outlook Anti-Spam"
.DeleteAfterSubmit = True
.Send
End With
=======================================
objItem.Delete
End If
Next
End If
The code below works fine with one message selected,
however, it crashes when multiple ones are selected with
the above runtime error.
The crash occurs between the ========= lines
But I think it is because of this line:
Set myForward = oExp.Selection.Item(1).Forward
Any ideas ?
Dim oExp As Outlook.Explorer
Set oExp = Outlook.ActiveExplorer
Set objSelection = oExp.Selection
If objSelection.Count > 0 Then
For Each objItem In objSelection
If TypeOf objItem Is MailItem Then
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set myForward = oExp.Selection.Item(1).Forward
SafeItem.Item = myForward
=======================================
With SafeItem
.Recipients.Add "#Unsolicited Email"
.Body = "Forwarded via Outlook Anti-Spam"
.DeleteAfterSubmit = True
.Send
End With
=======================================
objItem.Delete
End If
Next
End If