Results 1 to 12 of 12

Macro to transfer Selected Range to Outlook

Threaded View

  1. #1
    Registered User
    Join Date
    06-19-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    18

    Macro to transfer Selected Range to Outlook

    Good Morning

    I hope someone may be able to help.

    I am currently using a macro courtesy of www.rondebruin.nl to embed selected cells into Outlook. The macro commands do everything I want, except it prompts an e-mail to be sent automatically. Does anyone know of a way of displaying the e-mail before it gets sent. I have tried replacing "send" with "display" but this doesn't seem to work.

    I have pasted the macro below, any suggestions would be great.

    Regards
    Colin

    Sub Send_Range_Or_Whole_Worksheet_with_MailEnvelope()
    'Working in Excel 2002-2013
        Dim AWorksheet As Worksheet
        Dim Sendrng As Range
        Dim rng As Range
    
        On Error GoTo StopMacro
    
        With Application
            .ScreenUpdating = False
            .EnableEvents = False
        End With
    
        'Fill in the Worksheet/range you want to mail
        'Note: if you use one cell it will send the whole worksheet
        Set Sendrng = Worksheets("Sheet1").Range("A1:B15")
    
        'Remember the activesheet
        Set AWorksheet = ActiveSheet
    
        With Sendrng
    
            ' Select the worksheet with the range you want to send
            .Parent.Select
    
            'Remember the ActiveCell on that worksheet
            Set rng = ActiveCell
    
            'Select the range you want to mail
            .Select
    
            ' Create the mail and send it
            ActiveWorkbook.EnvelopeVisible = True
            With .Parent.MailEnvelope
    
                With .Item
                    .To = ""
                    .CC = ""
                    .BCC = ""
                    .Subject = "My subject"
                    .Send
                End With
    
            End With
    
            'select the original ActiveCell
            rng.Select
        End With
    
        'Activate the sheet that was active before you run the macro
        AWorksheet.Select
    
    StopMacro:
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
        End With
        ActiveWorkbook.EnvelopeVisible = False
    
    End Sub
    Last edited by Leith Ross; 06-19-2014 at 11:01 AM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] transfer a selected range of data on one sheet to another workbook
    By Ask Steve in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-23-2013, 01:36 PM
  2. send selected range in email with default outlook email signature included
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 10:50 PM
  3. [SOLVED] How to set range within a macro based on what range is selected on the worksheet
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2013, 12:49 PM
  4. when a certain category is selected
    By finigan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2013, 02:08 PM
  5. Is there a macro to transfer a row of data from top to bottom row of range ??
    By colwyn in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-25-2008, 04:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1