Home » Microsoft Technologies

Rich text field showing html code

I am an end user of Sharepoint. This issue only happens from my computer, not from any other within our organization. What happens is that when I edit an item in Sharepoint that contains a rich text field, HTML code is showing. Like so:

<div class=ExternalClassC900CFF4F2BF4312A89133C01A6E3C96> Some text</div>

This happens from any web browser. Sharepoint 2007 is used. I have Windows 7 x64.

Any idea what is causing this?


1 Answer Found


Answer 1

This is related to your browser.

Either you have some developer tools installed or something to that effect, or possibly, you could be on IE8.

If you are on IE8, try running the site in Compatibility Mode.  That should clear up the problem.

Start here:  http://blogs.msdn.com/b/ie/archive/2008/08/27/introducing-compatibility-view.aspx




Hi All,

I have a requirement in which I need to accept formatted text inputs from web page and save into database. further I have to generate word documents merging all the fields' formatted data into one doc. I thought to use a Rich Text Editor (HTML) on Asp.Net web page and saving HTML into Database and then from DB create the word doc by reading HTML from the fields (There may be some fields from which I also need to pick data and put at a particular location in the word doc). 

I know that we can generate RTF docs from HTML but are they fully conform with the RTF specifications means in parsing they should not create any table or any other object in word document if it is not present in Rich Text Editor. I mean to say that if I am writing something in para in Rich Text Box the text should come in para in my word doc (WYSIWYG).

Actually business users want to do formatting as they do in MS Word and then output (in .doc/.docx) should be exactly the same. Can we provide this by using HTML Rich Text Editor?

Secondly I have also tried WPF XBAP to provide Rich Interface, where I am getting all the rich text formatting options in WPF’s Rich Text Box. As user wants this on the web I am hosting my XBAP application in my .aspx page. To interact with database I am calling a WCF service in XBAP as there is restriction that File I/O and DB related activities cannot be performed directly if we are using XBAP with partial trust. I am using partial trust as I don’t want to install/download anything on client’s machine certificates/application. I just want that user should feel as they are using the a normal web page. I am generating XAML from RTB and saving it in the DB fields and from the fields I am converting XAML into .doc/docx.

What I want to know is which approach should I use:

simple HTML Rich Text Editor approach or WPF’s XBAP?

If I use HTML Rich Text Editor approach, Can this approach provide me all the capabilities as mentioned?


If I use XBAP will it be a good solution in terms of manageability , performance or any other thing?

In simple words what approach should I use?



Greetings all,


We're porting our 2007 list to 2010. In Sharepoint 2007, we used the following Calculated Column code to display a highlight over items that had different statuses:


=IF(Date="","<DIV style='background-color:#ff6666'>Not <b>Yet</b> Set</DIV>",

IF(Finalized=TRUE,"<DIV style='background-color:#66ff66'>Finalized</DIV>",

"<DIV style='background-color:#fffa91'>Tentative</DIV>"))


When we use this in Sharepoint 2010, it doesn't seem to apply the DIV structure. Any ideas of how we can change our code to make this work?




No matter -- I need to add a code snipped ( http://marijnsomers.blogspot.com/2010/01/write-html-code-in-sharepoint-via.html ) to the page... thanks!



I have a workflow that takes field content from one list and puts it into another.  The first field content on list 2 is just fine.  But the 2nd and 3rd ones are not.  They have the correct information, but are surrounded by html.  I am using the "Create item in" workflow command.

Example: <div>Addy Cust 5</div>

"Addy Cust 5" is correct, but not the <div> statements.

I checked the string types for each field on both lists, and they are identical -

Field 1 - string, single line

Field 2&3 are string, multiline.

Somehow the multiline causing it?

Thank you,


When I generate a simple report based on Activities that uses the Description field, the text shows the HTML code for some records.

For example, the text starts like this:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-

Then it has the real text from the email, then some more HTML code, etc.

How can I turn the HTML display off to make this readable by the end user?

Or, is there any other easy way to generate an readable report with email bodies (Activity Description)?


I'm using a Page Viewer Web Part on SP2003 to display a discussion board from a SP2007 team site.  the discussion board is displayed in an frame, however, when adding a new thread, the rich text editor visible directly on the team site is not visible.  Additionally, text that has been entered in a message is displayed with html coding when replying.   I've tried this on another version of SP2003 in use at my company, and there are no issues.  We don't know if there is a server configuration incorrectly set, or some other problem.

Essentially, it appears as though the RTE is being stripped from the display, and text is not being rendered without the HTML code being displayed.

Any help is appreciated.



So I have an issue that maybe someone of you have encountered as well. I am querying a Sharepoint list and creating a report from the data collected from this list. This all works fine except that one of the columns in this list is of the type "Multiple lines of text" and also supports "rich text" with different fonts, sizes and so on.

This has the effect that the text returned from this column is wrapped in HTML tags that specifies how the text should be formatted. Naturally I do not want this HTML code to appear in my report so for now I have used custom code to do a string.replace and replaced for example <div></div> and <br> with "".

However, this column also has url references to documents and these links shows up like this "/servername/site/subsite/Gemensamma%20dokument/Mwh.docx">http://servername/site/subsite/Gemensamma%20dokument/Mwh.docx

There is some sort of double reference to the document that I guess like the HTML tags are embedded in the answer from the rich text column and this is not so easy to do a string replace on because the url varies with the different document and document names.

My question really is if anyone of you have done a similar report that I am doing, and have encountered this fenomen with this sharepoint column and how you did to solve this? I have tried to create a placeholder inside the textbox in the report and stated that the content should be interpreted as HTML and that worked quite good. Only problem with that was that I lost most of the linebreaks in the text from this column and the text ended up not so readable.

So, mabye a bit tricky question but I hope you understand what I mean, otherwise I will be glad to try to explain it more.





I am using WPF RichTextBox. From that, I am reading the content in RTF format using the following code.

TextRange textRange = new TextRange(paramRichTextBox.Document.ContentStart, paramRichTextBox.Document.ContentEnd);
MemoryStream msData = new MemoryStream();
textRange.Save(msData, DataFormats.Rtf);
//get the data from the selected range//strData = textRange.Text;
strData = ASCIIEncoding.Default.GetString(msData.ToArray());

I also found that there is an option called DataFormats.HTML. Hence, I tried using this but ended up with error. Is there any other way to read the content of RichTextBox in HTML format?

Thanks in Advance!!!

Best Regards,
Subalakshmi Vijayarajan.


Hi, is there any documentation about what specific html tags and attributes may be generated in rich text and enhanced rich text fields?


I asked this question yesterday and somehow it is not in the forum any more.

Anyhow, asking again, some of the computers doesn't show rich text edit toolbar when we edit kb article or wiki on sharepoint. In that case it is showing as html code (ugly looking) :)

What could be the reason? Is it browser issue or what are the requirement so that it shows up.

mark it as answer if it answered your question :)

Hi All,

The User has an nText field on the Entity form to add some text (please note not the OOTB notes tab). The user wish to use some Rich text format here like Making text in Bold, Underline etc.

Is it possible to Use Rich Text formatting with CRM 4.0?

Thanks for your time



Hey guys,

I few weeks ago I got the rich text editing control to work on my master page, so that it would show up correctly in display or edit mode. I ended up removing it and not saving a copy and now for the life of me I can't figure out how I did it. Would anyone be able to tell me how to get it working again?


While in SP 2010 beta RTF fields where still available in SP 2010 RTM they are no more. You can add rtf fields to a list, but you can't add it to a document library anymore.

Does anybody know a workaround like a custom rtf field for SP2010? I really need to be able to add rich text meta data to my document library. Regards, Andreas


I'm working on a new program.  In this program the user will be able to collect data about another computer and then add additional information (images, text, etc).   They will then export this into a RTF or a Word Document.  So far all this is working perfectly.

Now I would like to have the user to have the ability to include attachments in this exported document.   If they manually copy a document and paste it into the Rich Text field, where they put in the additional information/images, it's there and when they export, everything works.  I can open the exported document see the attached document in there and open that document.

I would like to have this in a button.  They click the attach button and a file dialog opens.  They select the file and it will attach itself to the richtext field, or get added when the exported document is created.  I tried to search this on the net, but was not finding anything.

Any help would be appreciated.


I have combination of requied and not-required Rich Text Fields on the SharePoint List Forms. I have noticed two interesting behaviours of the Required Rich Text Field on the InfoPath List Forms for the SharePoint 2010.

1) Creating a new item using the List Form triggers the Required Field Validation. This is great but updating existing item using the List Form doesn't trigger the Required Field Validation, if field is cleared during the update process. It means, if I clear the data during the update process from the required Rich Text Field, it doesn't trigger the validation. I have made sure that both fields and control property has "required" checkbox selected.

2) Everytime User updates the List item using the InfoPath List Form, required Rich Text Fields submits updates to the SharePoint List even though they hasn't been changed by the end-user. Non-required Rich Text Field doesn't submit the field data. If you enable the versioning, you would notice that required rich-text fields (non-rich text field behaves fine) marks the data as updated causing false logging on the versioning history.

Has anyone else seen this behaviour?



I want to embed iframe tag in Sharepoint 2010 rich html text editor control, but it is simply remove the tags when i save the content.

Please let me know how can i do this?


I have one French publishing site. I want to set one page title like this: see BOTOX trademarkhere. To show title like this i need to put tag like Product <sup>MC</sup> . Problem is, if i put above tags in title text box at the time of page creation then page title showing Product <sup>MC</sup> not  like above site.


Regards, Sandip Patil, .Net,Sharepoint Developer www.worldofsharepoint.com

Iam using a custom list, one of the column datatype of the list is Multiple lines of text with type of text to allow as Enhanced Rich Text. Users in my site can copy any type of data and paste in that list coulmn. I need to display the list data in a webpart same as how it is copied. But after querying the list iam getting all the Style tags. How to avoid this.

For example, i copied the following text in the coulmn as below:

One advantage of using the SPGridView control in SharePoint-based solutions is that it has been integrated with the cascading style sheets that are built into Windows SharePoint Services 3.0. Also, the SPGridView control is heavily.
But after quering the list while displaying, following is the output iam getting. How to avoid the tags:

<div class=ExternalClass70B2A73EC47547F98E72395A66BC565C><div>One advantage of using the <strong>SPGridView</strong> control in SharePoint-based solutions is that it has been integrated with the cascading style sheets that are built into Windows SharePoint Services 3.0. Also, the <strong>SPGridView</strong> control is heavily </div></div>





I have a few rich text fields in a browser enabled infopath 2010 form. When I tried to submit it an error apppeared.

Retrieving the COM class factory for component with CLSID {52F5D46F-CBEA-4D07-BCB7-7296853F0CF2} failed due to the following error: 80040154. System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {52F5D46F-CBEA-4D07-BCB7-7296853F0CF2} failed due to the following error: 80040154.
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventRichTextChange.HtmlToCleanXHtml(String html, Boolean makeDomCompatible)


I deleted all rich text fields the form was submitted successfully.

Is this a bug of Infopath 2010? Is any ways to use rich text fields?


Best Regards,




I have an MS Access 2007 SP2 database. In a table I use a memo field with rich text formatting. If I paste a small piece of text from notepad into the memo field nothing happens.

Any clue?



I have created a site column in SharePoint 2010 environment using feature. Given below is the code I am using to create it.





DisplayName="Short Description"




Description="Enter Short Description for this item."




















Group="Custom Columns"
































AppendOnly="FALSE" />

Field is created successfully of type Enhanced Rich text, but when I am launching newform.aspx to create a new item in a list, curson is always jumped to this RTE field.
Then I tried to create a field of type Note, and it worked fine but in this field two or three options are disabled in ribbon.

So it will be really helpful if somebody knows the reason why curson is jumping to this field.


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure