473,388 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Outlook XP Add-in

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 = "xx*@xxx.com" '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?
Jul 21 '05 #1
1 1250
Skip the first question...I just figured it out.... My new question is instead of doing oEmailMessage.Delete() can I permanently delete the message?
"Nicholas Then" wrote:
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 = "xx*@xxx.com" '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?

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marcel Stör | last post by:
Hi all, I'm trying to add a user property to an Outlook contact item. VisualStudio tells me that the method signature was like this: UserProperties.Add(string Name,Outlook.OlUserPropertyType...
1
by: Jonathan Pinto | last post by:
I was wondering if it would be possible to snapshot an access report to Outlook, and have fields come in the To: and Cc: fields, and also the subject field of the email as well. Right now, I am...
0
by: Marcel Stör | last post by:
Hi all, I'm trying to add a user property to an Outlook contact item. VisualStudio tells me that the method signature was like this: UserProperties.Add(string Name,Outlook.OlUserPropertyType...
4
by: Nicole | last post by:
I found this code below to use to send emails using VB with Outlook. However, it gives these errors. 'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and...
3
by: Matt | last post by:
I'm trying to do the following, pulling from Outlook with an independent project: 1. The day's Outlook appointments, with person that the appointment was scheduled with 2. Add a list of...
7
by: John | last post by:
Hi I am using the following code to automate outlook from within MS Access; Dim O As Object O = CreateObject("Outlook.Application") The problem is that I am getting the following error on...
1
by: jeff.boggs | last post by:
Hello, I have a problem inserting HTML from a Word document into a new Outlook mail message. The message ends up losing all of the formatting and the image that is supposed to appear at the top...
3
by: mwolowski | last post by:
Hello, I'd like to add tasks, appointments, etc using c# to outlook For example i added reference using OutLook = Microsoft.Office.Interop.Outlook; and the code: 1. ---------------------...
4
by: Andy | last post by:
Hi, I have a C# application and I'd like it to use Outlook 2003 to send messages. I don't want to send them programmaticlly though; I just want to open the New Messge window, set the...
0
by: DianaC | last post by:
Hi. I have to generate and send emails from C#.net 2.0 and have to use outlook. I am using Redemption to bypass the outlook security checks, but have the same problem when using CDO. I create an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.