I use a rule in Outlook to run a script on every received e-mail that forwards it. It always works for a couple days, but then I get a message that says "rule encountered an error", and then I have to reactivate the rule manually.
I'd love to figure what is causing the error, but at the very least, I'd like whatever item caused the error to just be skipped.
Here's the code:
Sub DoForward(Item As Outlook.MailItem)
On Error Resume Next
'Grab the item and create a forward
Dim myFwd As Outlook.MailItem
Set myFwd = Item.Forward
'Set my e-mail as the recipient
myFwd.Recipients.Add "email@email.com"
'Set the sent e-mail to delete after sending
myFwd.DeleteAfterSubmit = True
'And send it off
myFwd.Send
'Clean-up
Set myFwd = Nothing
End Sub
Any ideas would be appreciated. Thanks!
Dan
Bookmarks