Re: Code to check for HTML messages being sent

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Sounds over complicated to me. I'd just get HTMLBody as a string and then break it down by line breaks. First I'd find the starting point of the <body> tag and then look for the terminating ">" on that. Then I'd extract all of the string between there and the start of the </body> tag, that's the actual body content.

From there I'd look for breaks such as <br> and paragraphs and whatever
other breaks are in the text and count characters between the breaks.

Of course you also have to account for non-character tags such as <td>, <tr>, etc. and for attributes such as font, color, etc.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jarryd" <jarryd@xxxxxxxxxxxx> wrote in message news:e3sZqgvdJHA.3520@xxxxxxxxxxxxxxxxxxxxxxx
Hi Ken,

What I was think I would need to do is put all the lines of HTML data in the body of the message in an indexed (multiples of 10) array, line by line. Then I would delete the message body. Then I would run through each line in the array and check it for the number of characters contained. For any that contain more that 900 then I would insert an entry that is indexed 1 above the affecting line. So if line 3 was too long containing 3000 characters it would have an index of 30 and I would create three more lines and index them:
31, containing 900 characters
32, containing 900 characters, and
333 containing 300 characters.

I would then sort the array in ascending order on the index and write it back to the body of the message (without the index column that is).

That all sounds like a lot of mission. Am I perhaps over-complicating things? Is there not a better way to get at it?

TIA,

Jarryd

.



Relevant Pages

  • Re: Help a beginner - simple lowercase to uppercase and so on function
    ... And then one to loop across the string calling that function ... copying at to a new array. ... are any characters other than lowercase letters */ ...
    (comp.lang.c)
  • Re: fgets question
    ... documentation didn't say if fgets put \0 after a string literal. ... fgets() has nothing at all to do with string literals. ... within the bounds of the array, then it is not a string. ... strlenon an array of characters that is not a string, ...
    (comp.lang.c)
  • Re: left$, mid$ and right$ (was: ANN: pldev.org)
    ... I avoided saying an array of characters ... used option and discuss a string as an array of characters. ... (Similar could be said of a list if the language ...
    (comp.lang.misc)
  • Re: newbie: mapping CHARACTER*2 to INTEGER*2
    ... that destroys the Chinese characters in my input. ... effect the conversion required. ... If MOLD is an array and SIZE is omitted, ... represent the values 4.0 and 1082130432 as the string of binary digits ...
    (comp.lang.fortran)
  • Re: Help creating a random string in Perl
    ... can pick one of the 7 characters in my source string) by using "print ... third and fourth characters to and check that the random number hasn't ... shuffling the array ... The idea here is to swap the current cell with some cell ...
    (perl.beginners)