email by vba .display : .save. : .close the created email draft

drom

Well-known Member
Joined
Mar 20, 2005
Messages
528
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi and Thanks in advance!

When I want to sent a mail using outlook and VBA I can use:
Code:
With OutMail
            .to = "peter123456@gmail.com"
            .CC = "peter123457@gmail.com"
            .BCC = "peter123458@gmail.com"
            .Subject = "My Name is Blas!"
            .HTMLBody = RangetoHTML(Source)
            .Attachments.Add ("C:\test1.txt")
            .Attachments.Add ("C:\test2.txt")
            .Display   'or use .Send
            .Save
            .Close 'close the created and saved draft mail???????????????????????????????
        End With

but how can I revert
OutMail.display to close the created draft mail after saving it?
PS:
I know how to save in draft, but my question is how can I display, save and then close

I need to display because I have to paste a few images and without .display does not work properly

so question:
.display: .save: .close ???
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi

How about inserting
Code:
Dim Delay As String

then
Code:
' add delay time        hh:mm
Delay = Now + TimeValue("00:05")

just before Set Outmail
you could then edit the emails in the outbox before they are sent

this will also save you using .Display,, so saving you time

Paulxmw
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top