G
Guest
My company like many companies has spam issues. I am developing a outlook add-in that can forward a message to a mailbox for further spam processing. This works, but is there a way that I can get the forwarded message to not show up in the users sent items folder. We are trying to get rid of spam and not make a copy of it hehe...
Here is what I am doing
Dim oEmailMessage As Outlook.MailItem = CType(m_olApp.ActiveInspector.CurrentItem, Outlook.MailItem)
Dim oNewEmailMessage As Outlook.MailItem = oEmailMessage.Forward
oNewEmailMessage.To = "(e-mail address removed)" 'Spam Address
oNewEmailMessage.Send()
oEmailMessage.Delete()
'The above code works...
If I add oNewEmailMessage.DeleteAfterSubmit = True then I get Object not set to instance of an object. Is there a way that I can prevent a forwarded message from being saved?
Here is what I am doing
Dim oEmailMessage As Outlook.MailItem = CType(m_olApp.ActiveInspector.CurrentItem, Outlook.MailItem)
Dim oNewEmailMessage As Outlook.MailItem = oEmailMessage.Forward
oNewEmailMessage.To = "(e-mail address removed)" 'Spam Address
oNewEmailMessage.Send()
oEmailMessage.Delete()
'The above code works...
If I add oNewEmailMessage.DeleteAfterSubmit = True then I get Object not set to instance of an object. Is there a way that I can prevent a forwarded message from being saved?