+ Reply to Thread
Results 1 to 12 of 12

Macro to transfer Selected Range to Outlook

  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

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 06-19-2014 at 11:01 AM. Reason: Added Code Tags

  2. #2
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro to transfer Selected Range to Outlook

    It should be as you've tried... Changing .send to .display. You definitely included the "." when you tried changing to .display?

  3. #3
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro to transfer Selected Range to Outlook

    Actually, I misunderstood. I thought it was just emailing a sheet. I commented out .send and the ActiveWorkbook.EnvelopeVisible = False line, and running the macro now shows the envelope, populates the fields with what you specify and stops there.

    Is that what you wanted?

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

    Re: Macro to transfer Selected Range to Outlook

    Thanks for that, getting closer to what I am trying to achieve. I notice that the draft e-mail appears within the Excel Worksheet rather than Outlook.

    Ultimately, what I would like is to run a macro that populates a draft e-mail in outlook with a selected range of cells, within the body of the e-mail as opposed to being an attached worksheet. The user can then review the e-mail before it goes out.

    Regards

    Colin

  5. #5
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro to transfer Selected Range to Outlook

    Ah, I see. that's what I originally thought your code was meant to do.

    I adapted another of Ron De Bruin's samples for that but I can't seem to find it on the site any more. Here is my code with anything specific to what I use it for taken out. Write back here if you need any help adapting it to your needs. All credit to Ron

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by diberlee; 06-19-2014 at 09:43 AM.

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

    Re: Macro to transfer Selected Range to Outlook

    Quote Originally Posted by diberlee View Post
    Ah, I see. that's what I originally thought your code was meant to do.

    I adapted another of Ron De Bruin's samples for that but I can't seem to find it on the site any more. Here is my code with anything specific to what I use it for taken out. Write back here if you need any help adapting it to your needs. All credit to Ron

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks, I have used the macro at the top, which does look as though it should work, my outlook draft opens up but appears blanks. I assume I have to set the range, am maybe going wrong somewhere with the HTML Range. The range on my workbook is Sheet1!B1:J45, how/where do I paste this in?

    Colin

  7. #7
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro to transfer Selected Range to Outlook

    Hi,

    You should set that in the 8th line down of the first macro.

    Cheers

    EDIT: Updated earlier post to show correct code for the sheet/range you are using
    Last edited by diberlee; 06-19-2014 at 09:44 AM.

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

    Re: Macro to transfer Selected Range to Outlook

    Thanks for your continued help. I am now receiving an error message, "Compile Error, Sub or function not defined". I am not sure quite where I am going wrong!

    The macro now looks like this in VBA:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 06-19-2014 at 11:02 AM. Reason: Added Code Tags

  9. #9
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro to transfer Selected Range to Outlook

    Hi,

    Sorry for slow reply. Busy day today

    I checked and it's working fine for me. Recopy the code from my 3rd message (I updated it to work with the sheet/range you need). Make sure you take both the sub and the function. Paste them in the same module for simplicity.

    Cheers

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

    Re: Macro to transfer Selected Range to Outlook

    Diberlee,

    I have realised what I have been doing wrong, the macro has to be run with the RangetoHTML subroutine. (Next time I'll pay closer attention.) I have now put the two macros together and have achieved what I wanted.

    Many thanks indeed for your help!

    Regards

    Colin

    http://www.rondebruin.nl/win/s1/outlook/bmail2.htm
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 06-19-2014 at 11:03 AM. Reason: Added Code Tags

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

    Re: Macro to transfer Selected Range to Outlook

    Quote Originally Posted by diberlee View Post
    Hi,

    You should set that in the 8th line down of the first macro.

    Cheers

    EDIT: Updated earlier post to show correct code for the sheet/range you are using
    Go it!! Thanks very much for your help, I am most grateful,

    Regards

    Colin

  12. #12
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Macro to transfer Selected Range to Outlook

    Hi Colin/Diberlee,

    your post helped me a lot and i used the similar thing in my work.

    Kindly let me know how to insert signature in every mail that is generated by this macro.

    I tried adding signature code by Ron... but am failed, i didn't know where to add. Kindly help me in this.

    Thanks for your time and consideration.

    -Bala
    Bala

+ Reply to Thread

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. [SOLVED] 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