Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a Outlook AddIn where I have to get the Outlook mailbody and store it in a control which can be manipulated for my requirement.
The code is like this:

C#
Outlook.Application oApp = new Outlook.Application();
Outlook.Explorer oExplorer = oApp.ActiveExplorer();
Outlook.Selection oSelection = oExplorer.Selection;
foreach (object item in oSelection)
{
htmlEditor1.Html = mailItem.HTMLBody;
}


I checked for htmlbody format using

C#
oldMailItem.BodyFormat.ToString();


It is giving olFormatHTML which is different from standard HTML.

How I can get the standard HTML from Outlook ?
Posted
Comments
Maciej Los 25-Nov-15 6:03am    
What you mean "different"?
Digambar Malla 25-Nov-15 6:39am    
I am saying different because mailitem.htmlbody is giving output in a format like "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o = " which is RAW html but it should have been as simple as this : "some text checking\r\n"

1 solution

 
Share this answer
 
Comments
Digambar Malla 25-Nov-15 5:43am    
Thanks for the response. I already know that :)
Richard MacCutchan 25-Nov-15 6:01am    
But do you understand what it means?
Digambar Malla 25-Nov-15 6:44am    
Richard, mailitem.htmlbody is giving output in a format like "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o = " which is RAW html but it should have been as simple as this : "some text checking\r\n".
Richard MacCutchan 25-Nov-15 7:48am    
Yes, that is standard HTML. You seem to be confused as to what HTML actually is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900