Re: Code to check for HTML messages being sent
- From: "Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx>
- Date: Thu, 15 Jan 2009 10:12:55 -0500
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 whateverother 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
.
- Follow-Ups:
- Re: Code to check for HTML messages being sent
- From: Jarryd
- Re: Code to check for HTML messages being sent
- References:
- Code to check for HTML messages being sent
- From: Jarryd
- Re: Code to check for HTML messages being sent
- From: Ken Slovak - [MVP - Outlook]
- Re: Code to check for HTML messages being sent
- From: Jarryd
- Re: Code to check for HTML messages being sent
- From: Jarryd
- Re: Code to check for HTML messages being sent
- From: Ken Slovak - [MVP - Outlook]
- Re: Code to check for HTML messages being sent
- From: Jarryd
- Re: Code to check for HTML messages being sent
- From: Jarryd
- Code to check for HTML messages being sent
- Prev by Date: Re: deleting multiple appointments
- Next by Date: Re: Move email to directory folder, and then move email to another fol
- Previous by thread: Re: Code to check for HTML messages being sent
- Next by thread: Re: Code to check for HTML messages being sent
- Index(es):
Relevant Pages
|