473,396 Members | 2,034 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,396 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 1251
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.