Create an email with this Macro, but dont send, just show for me to edit

beepbeep27

New Member
Joined
May 7, 2012
Messages
21
Im trying to use this macro which allows me to send an email with highlighted text in the body. The problem is I have to change emails and add/take out on each one. I was hoping to modify this macro so it will open the email with the highlighted text, etc but not send until i manually do so. Any help welcomed!

Sub


Send_Selection_Or_ActiveSheet_with_MailEnvelope()
'Working in Excel 2002-2016
Dim Sendrng As Range


On Error GoTo StopMacro


With Application
.ScreenUpdating = False
.EnableEvents = False
End With


'Note: if the selection is one cell it will


send the whole worksheet
Set Sendrng = Selection


'Create the mail and send it
With Sendrng


ActiveWorkbook.EnvelopeVisible = True
With .Parent.MailEnvelope


' Set the optional introduction field


thats adds
' some header text to the email body.
.Introduction = "Text in the body"


With .Item
.To = "email@email.com"
.CC = ""
.BCC = ""
.Subject = "Follow-up"
.Send
End With


End With
End With


StopMacro:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveWorkbook.EnvelopeVisible = False


End Sub
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
15,201
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Try replacing .Send with .Display (as per Ron's instruction where you got the code from...see quote below the code) and comment out the last line...

Rich (BB code):
Sub Send_Selection_Or_ActiveSheet_with_MailEnvelope()
    'Working in Excel 2002-2016
    Dim Sendrng As Range


    On Error GoTo StopMacro


    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With


    'Note: if the selection is one cell it will


    'send the whole worksheet
    Set Sendrng = Selection


    'Create the mail and send it
    With Sendrng


        ActiveWorkbook.EnvelopeVisible = True
        With .Parent.MailEnvelope


            ' Set the optional introduction field


            'thats adds
            ' some header text to the email body.
            .Introduction = "Text in the body"


            With .Item
                .To = "email@email.com"
                .CC = ""
                .BCC = ""
                .Subject = "Follow-up"
                .Display
            End With


        End With
    End With


StopMacro:
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With

    ' ActiveWorkbook.EnvelopeVisible = False


End Sub

From Ron de Bruin's site
I personally not like to use the VBA MailEnvelope code because it will use the Excel window instead of creating a separate Outlook mail. When you use the code examples in the two links below you can use .Display instead of .Send in the code and it will create a separate Outlook mail and you can view it first if you want.
 
Upvote 0

Forum statistics

Threads
1,195,994
Messages
6,012,751
Members
441,724
Latest member
Aalbid

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
Top