View Single Post
  #7  
Old March 10th 09, 01:21 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default mailItem.HTMLBody should retrieve only current text

If you are specifically looking for "please see below" then it's easy to
find that text.

Outlook will rewrite your HTML, and how it's rewritten depends also on what
email editor is being used. If necessary you have to experiment with that
and possibly set up different tests depending on whether or not WordMail is
being used and what version of Outlook the code is running on.

One trick you can use is to get the text without all the HTML tags by
reading the Body property to get the plain text equivalent. That makes it
easier to find the end of the previous message, once you have that you can
search for the equivalent text in the HTMLBody. Then you apply logic that
starts at that position and works backwards or forward to find the enclosing
tags for that section.

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


"Nagaraj" wrote in message
...
Hello Ken,

I have the following text in the original text within the body


divplease see below. i will send another one where its coming on top of
the email./divdivbr/divdivraghu/divdiv
style="font-family:times
new roman, new york, times, serif;font-size:12pt"brdiv
style="font-family:times new roman, new york, times,
serif;font-size:12pt"font size="2" face="Tahoma"----- Forwarded Message
----brbspan style="font-weight: bold;"From:/span/b Steve
Waterhouse
brbspan style="font-weight:
bold;"To:/span/b brbspan style="font-weight:
bold;"Sent:/span/b Thursday, March 5, 2009 3:22:01 PMbrbspan
style="font-weight: bold;"Subject:/span/b FW: testbr/fontbr



new text message contains


div class=Section1

p class=MsoNormalspan
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'fwdo/o/span/p

p class=MsoNormalspan
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'o /o/span/p

div

div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in
0in
0in'

p class=MsoNormalbspan
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'From:/span/bspan
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"' sridhar
] br
bSent:/b Friday, March 06, 2009 2:36 AMbr
bTo:/b Nagarajbr
bCc:/b Vikram Rayabharibr
bSubject:/b Fw: testo/o/span/p

/div

/div

p class=MsoNormalo /o/p

div

div

p class=MsoNormalplease see below. i will send another one where its
coming
on top of the email.o/o/p

/div

div

p class=MsoNormalo /o/p

/div


My problem is I am unable to search the text in the original text

divplease see below. i will send another one where

in the new message text because in the new text p class=MsoNormal tag is
attached to the modified text as follows

div

p class=MsoNormalplease see below. i will send another one where its
coming


Can you suggest me how to get the index of 'please see below' in the new
message text


Thanks


Ads