![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
while replying to messages, when I use mailItem.HTMLBody I am getting entire
body including previous messages. I want to get only current entered new text but not previous messages. Can anyone know how to do it in C# -- Nagaraj Tadipatri |
Ads |
#2
|
|||
|
|||
![]()
Get the previous message that's being replied to and find the text between
the body and /body tags. Then get the current reply message and get the same from there. Do a diff on the two and what's left is the new text. -- 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 ... while replying to messages, when I use mailItem.HTMLBody I am getting entire body including previous messages. I want to get only current entered new text but not previous messages. Can anyone know how to do it in C# -- Nagaraj Tadipatri |
#3
|
|||
|
|||
![]()
What would happen if the user repling to a message makes edits to the
original message body? I do it all the time. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Nagaraj" wrote in message ... while replying to messages, when I use mailItem.HTMLBody I am getting entire body including previous messages. I want to get only current entered new text but not previous messages. Can anyone know how to do it in C# -- Nagaraj Tadipatri |
#4
|
|||
|
|||
![]()
Thank you Ken for your reply.
My actual requirement is I already have some message replied to me. Whenever I reply back to him I want to display (company signature) immediately after new text which i reply to him. But what is happening is the signature is displayed after entire text (current text and previous message). My current code mailItem.HTMLBody = mailItem.HTMLBody + adContent.text; where adContent.text is the company signature. My requirement is i want to display company signature immediately after my reply text but not at end of entire message( current + previous messages). Do you have any C# code to do this? Thanks is -- Nagaraj Tadipatri "Ken Slovak - [MVP - Outlook]" wrote: Get the previous message that's being replied to and find the text between the body and /body tags. Then get the current reply message and get the same from there. Do a diff on the two and what's left is the new text. -- 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 ... while replying to messages, when I use mailItem.HTMLBody I am getting entire body including previous messages. I want to get only current entered new text but not previous messages. Can anyone know how to do it in C# -- Nagaraj Tadipatri |
#5
|
|||
|
|||
![]()
You will have to do what I said, any code I have for something like that is
so customized for specific clients it wouldn't do you much good. Find the original text within the body /body tags and the new text in the reply message and find where the new text was added to the old text. You might also have to parse the text to remove any existing signatures if they are present in the text. -- 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 ... Thank you Ken for your reply. My actual requirement is I already have some message replied to me. Whenever I reply back to him I want to display (company signature) immediately after new text which i reply to him. But what is happening is the signature is displayed after entire text (current text and previous message). My current code mailItem.HTMLBody = mailItem.HTMLBody + adContent.text; where adContent.text is the company signature. My requirement is i want to display company signature immediately after my reply text but not at end of entire message( current + previous messages). Do you have any C# code to do this? Thanks is -- Nagaraj Tadipatri |
#7
|
|||
|
|||
![]()
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 ![]() ![]() p class=MsoNormalspan style='font-size:11.0pt;font-family:"Calibri","sans-serif"; color:#1F497D'o ![]() ![]() 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 ![]() ![]() /div /div p class=MsoNormalo ![]() ![]() div div p class=MsoNormalplease see below. i will send another one where its coming on top of the email.o ![]() ![]() /div div p class=MsoNormalo ![]() ![]() /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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Referencing Active/Current/Selected MailItem | MJS | Outlook and VBA | 1 | January 14th 07 08:51 AM |
HTMLBody Property of Outlook MailItem | Judy | Outlook - Using Forms | 1 | December 27th 06 01:46 AM |
Creating a new mailItem with a signature, and a modified HTMLBody | Peter Reinhold | Add-ins for Outlook | 6 | November 10th 06 03:52 PM |
extracting mailitem.body text to Excel columns | Junoon | Outlook and VBA | 3 | April 20th 06 05:45 AM |
Retrieve current item on TaskPad in Calender | Michael Bauer | Outlook and VBA | 0 | January 9th 06 08:04 AM |