RadEditor for ASP.NET

Cleaning Word Formatting On Page Load Send comments on this topic.
Handling Content > Cleaning Word Formatting On Page Load

Glossary Item Box

 

 You can use the following JavaScript function to strip MS Word content formatting on editor load by attaching it to the editor OnClientLoad event, e.g.

ASPX Copy Code
<script type="text/javascript">
function OnClientLoad(editor)
{
   // the code below will call the Format Stripper tool with the "Word" option
   // the other possible options are All, CSS, WORD_ALL
   oTool = new Object();
   oTool.GetSelectedValue = function() { return "WORD"; }
   editor.Fire("FormatStripper", oTool);
}
</script>

<
rad:RadEditor id="RadEditor1" Editable="true" Runat="server" SaveInFile=true OnClientLoad="OnClientLoad">


<
p><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">  </p>
<
p class=MsoNormal><b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 10pt; BACKGROUND: red; COLOR: #ff9900; mso-bidi-font-family: Arial; mso-highlight: red">Sampe MS Word content</span></b><b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 10pt; COLOR: #ff9900; mso-bidi-font-family: Arial"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></span></b></p></span></span>


</
rad:RadEditor>

Note that the function must precede the editor declaration.