Solved

VBA Send email but do not save in sent items

Posted on 2008-10-21
3
1,696 Views
Last Modified: 2012-05-05
Hello all,

I have an app which emails XLS files to a client.  This works fine but we send about 150-200 200k files every day so my Sent Items folder quickly fills up with 30MB of files or so every day.  I do not need these files once they have been sent so my question is:

How can I continue to send the files but for Outlook to not save the message in Sent Items.  I have a search folder configured to identify these emails so I just periodically empty this folder.  My code is attached below, hopefully someone can tell me a simple command to force Outlook to just send the email without saving it

Set olapp = CreateObject("Outlook.Application")
Set oItem = olapp.CreateItem(0)
With oItem
      .Subject = "Purchase Order: PO" & Trim(Str(numb + 1))
      .To = emailaddress
      .Attachments.Add "C:\PO " & Trim(Str(numb + 1)) & ".xls"
      .Send
End With

Set olapp = Nothing
Set oItem = Nothing

I am away until next Monday so if I don't respond until then thanks for your responses.

Cheers

Gary
0
Comment
Question by:garygreen
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
rnevet earned 50 total points
ID: 22767421
Try before using .Send

setting
.DeleteAfterSubmit = True;

http://msdn.microsoft.com/en-us/library/aa211833(office.11).aspx
0
 

Author Comment

by:garygreen
ID: 22767455
Found the answer myself, thanks for everyone who looked at this anyway

  .DeleteAfterSubmit = True
0
 

Author Comment

by:garygreen
ID: 22767460
Will give you the points rnevet as you got there before me!

Cheers
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question