+ Reply to Thread
Results 1 to 4 of 4

RangetoHTML to paste cell content instead of table with content

  1. #1
    Registered User
    Join Date
    01-11-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    7

    RangetoHTML to paste cell content instead of table with content

    Hi all! I am new to this so please excuse any newbie mistakes. I am usually able to find what I am looking for by searching the forums but did not see this brought up by anyone else.

    I am using the popular Ron De Bruin RangetoHTML function Ron De Bruin RangetoHTML function to insert Excel cell text as HTML text into a new Outlook email message. I have only changed two lines of code, the rng reference early on to point to a specific named range within my workbook and the PasteSpecial section of the function to help keep the formats intact so I don't think those should affect any potential answer that will be provided. For what it is supposed to do, the code works fine with no errors. But it appears the way it works is to paste the contents within a table into the email body and it can be dragged around the email which is not exactly what I was looking for.

    I understand this may be how the function is set up currently, but is there anyway to make it so that the contents of the cell is pasted inline in the Outlook email body (as if I had just copied the cell from Excel, placed the cursor into the new email body and hit paste)? Just to make it easier to reference, I will include the exact code I am using below changing the name of my named cell.

    Any help at all would be greatly appreciated!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-11-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    7

    Re: RangetoHTML to paste cell content instead of table with content

    I figured it out!!! The issue was how the HTML text was being retrieved from the file after it was published to the .htm file within the RangetoHTML function. I figured this out by changing the .HTMLBody to .Body so that I could see the exact HTML text being used. I noticed there were a few references to tables throughout the HTML code so I added a few more replace functions to the Ron De Bruin function to take out all references to tables of any kind and now it is almost perfect! There is just an annoying extra line at the very top when the message is composed. Any tips on this?

    I have tried including the updated code here but I believe the few replace functions that include the table related HTML text are blocking me since I get the message "HTML code not allowed" so I guess I can't include that info.
    Last edited by moe15243; 01-11-2017 at 05:37 PM.

  3. #3
    Registered User
    Join Date
    01-11-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    7

    Re: RangetoHTML to paste cell content instead of table with content

    I am all set, figured out the extra space as well. I suppose I should thank you all anyway though. I appreciate the work that is done here and it has helped me countless other times in my amateur coding adventures. Thanks!

  4. #4
    Registered User
    Join Date
    10-03-2018
    Location
    Auckland
    MS-Off Ver
    2016
    Posts
    1

    Re: RangetoHTML to paste cell content instead of table with content

    I'm in the same boat buddy - do you still have your solution?

+ 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. Replies: 9
    Last Post: 09-16-2015, 08:00 PM
  2. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  3. [SOLVED] Search content from cell A1 in Sheet2 and select the content found
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2013, 06:45 PM
  4. copying cell content into a specific workbook based on the content in that cell
    By krishna reddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2012, 03:52 AM
  5. [SOLVED] Highlight a cell if its content doesn't match another cells content
    By noxygen in forum Excel General
    Replies: 4
    Last Post: 04-12-2012, 04:36 AM
  6. Change ws3 Cell Content Depending On ws1 Content
    By heliskier89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2011, 04:52 PM
  7. Replies: 2
    Last Post: 12-19-2006, 10:50 PM

Tags for this Thread

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