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!
 

brucemc

New Member
Joined
Aug 6, 2003
Messages
33
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!
 

Forum statistics

Threads
1,082,017
Messages
5,362,695
Members
400,686
Latest member
Aakash

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top