Excel range to HTML for Outlook message body

brucemc

New Member
Joined
Aug 6, 2003
Messages
33
Good Day All!

Mr. de Bruin has outstanding examples from which I have learned much. Unfortunately I have hit a roadblock in my attempts to convert a range to html and send it. For some unknown reason the range gets truncated horizontally (not at all vertically) as if a line is drawn down the first 1/3 of the page and everything right of that line is erased.

It sends perfectly using MailEnvelope, except I do not like using that for the same reasons as stated by Mr. de Bruin.

The range I wish to send is roughly the width of the alphabet (US) written four times end to end, with a fifth time up to the letter "o" in Calibri 11 pt.

When the html letter body is displayed in Outlook (I use .Display rather than .Send) it is truncated at the third repetition at the letter "d". This point in the width is true for the entire length of the range selected, so if we simply started the alphabet at the horizontal point where the second repetition would have ended, all that would appear on that email line would be "abcd".

I followed Mr. deBruin's code into the html conversion procedure and the copy onto the temporary workbook was complete; the problem comes somewhere in the html conversion itself after the line:

" 'Publish the sheet to a htm file", for after that point I am unable to inspect the resulting output.

For those unfamiliar with his code (Is there anyone?) Mail Range/Selection in the body of the mail in the Function: Function RangetoHTML(rng As Range)

Can anyone advise just what is going on?

Many thanks!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
For those that might run into the problem in the future I am posting the solution-

The range I selected was roughly 12 columns wide. Text lines were posted into the first four (4) columns of this range.

Excel, well, instead of getting censored for colorfully describing my observation, I will just restate what Mr. de Bruin wrote to me:

"Office is not very good at creating html"

Woof. He is polite!

The solution was to change the method in which I formatted the appearance of the range I wished to send as the body of the email. I needed to post each line to the same column and when I wished to start a line partway across the page to provide for the indentation within that line, and not by placing the text in a column or two to the right, then I needed to change my range to just that one column. That was fun. (Alternate definition of "fun".)

Great thanks to Mr. de Bruin for coming to my aid!
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

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
Back
Top