+ Reply to Thread
Results 1 to 10 of 10

Copy specific cells as text into body of a new OUTLOOK message

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Copy specific cells as text into body of a new OUTLOOK message

    Hello all: I have used this amazing forum before and had great success and I have been looking hard for this answer and found some code that doesn't quite work and I am sure you smarty-pants out there can help.

    I have a excel 2010 and our company uses OUTLOOK (I believe Office 365) as it's email service.

    I am trying to have a command button at the bottom of the attached form to basically copy cells A1:O85 to the body of an email as plain text.

    If I have done this right, the file should be attached.

    Can someone help me with the code?

    Thanks,
    Last edited by guido0136; 09-10-2014 at 01:30 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Hi,

    I can do no better than point you to Ron de Bruin's ever helpful web pages on this subject.

    See http://www.rondebruin.nl/win/s1/outlook/bmail2.htm
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    I have been to this site a few times and none of the samples I have used seemed to work, perhaps it's something I am doing wrong. Let me try again, and if it doesn't work, I'll post the file/code/ and the error(s).

  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Okay, the first code seemed to work, This one:

    Please Login or Register  to view this content.
    But this is a form that uses drop down lists that depending on the data in the cell (Selected by this drop down list) will hide fields no longer needed. As soon as the first drop down list removes (hides) some rows, the command button still opens an email, but there is no data. As long as the you fill in other fields and click the command button it works fine but as soon as some rows are auto-hidden, no data is copied to the body of the email.

    Thoughts?
    Last edited by guido0136; 09-10-2014 at 02:22 PM.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    And are you now changing your original requirement, which was as I understood it to replicate exactly all of A1:O85 in the body of an email.

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Added the
    Please Login or Register  to view this content.
    tags.

  7. #7
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    I think I got the issue. There were merged cells in columns as well as rows that for some reason, when the auto.hide function triggered, it did show in the email. I fixed this and it worked.

    Thanks,

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Quote Originally Posted by guido0136 View Post
    I think I got the issue. There were merged cells ....
    ...ahhh, the dreaded words. A word of general advice. Most of us avoid merged cells like the plague. They are just too troublesome and you can almost guarantee that sooner or later they will trip you up. If you're lucky they'll trip up and something will crash so that you know something untoward has happened. If you're unlucky then you might just get wrong results and never know. Avoid them. The most common use of merged cells is simply to position a value midway across a range of cells. In which case the format 'Centre (OK Center if you're the wrong side of the pond ) across Selection' is to be preferred.

  9. #9
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Thanks, I have learned my lesson. Thanks,

  10. #10
    Registered User
    Join Date
    05-30-2012
    Location
    Mississauga, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Copy specific cells as text into body of a new OUTLOOK message

    Hello all, I am back. :-) While the code is working flawlessly, I had a request from an end user to see if a modification can be done.

    The function to open and copy a range of cells into the body of a new email is working great, but the team this email goes to, copies and pastes the 'data' from the email into an I.T. Ticketing system, which is a basic a text box, and they dis-like all the 'blank lines' (or Rows) once pasted into their ticketing system. I have tried to reduce the height of the rows in the Excel sheet, but when the code is run, it appears the height of each row is ignored.

    I have also tried to insert more code into this module to remove blank rows before this code runs, and while there are no errors given the removal of blank rows code does nothing and I have tried a number of different codes to do this.

    The blank rows in the Excel 'Form' are needed as it is a user form the people fill out, and the blank rows make it easier to fill the form out.

    Any ideas how I can (at the beginning of Ron DeBruin's code) remove the blank rows and then have the rest of the code run so the email will appear with no blank rows in it?

    Thanks,

    G.

+ 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. Help with Copy Range from Tab and Paste In Outlook Email Message Body.
    By N4VBA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2014, 03:40 PM
  2. Excel VBA to open new outlook message with signature and preferred body text format
    By morayman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2013, 10:01 AM
  3. Add to Excel from Outlook when a email body contain a specific text
    By mathewfer in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2013, 08:28 AM
  4. Extract outlook message body text with VBA from Excel
    By jamsta1972 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2012, 05:43 PM
  5. Get text from body of open outlook message
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2010, 04:53 PM

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