Hi Paul,
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.
<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>
<rade:RadEditor id="RadEditor1" 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>
</rade:RadEditor>
You can also fire the stripping code below when submitting the content too by using the OnClientSubmit event
<script type="text/javascript">
function OnClientSubmit(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>
<rade:RadEditor OnClientSubmit="OnClientSubmit" id="RadEditor1" Editable="true" Runat="server" SaveInFile=true>
<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>
</rade:RadEditor>
The code works for IE and Mozilla (Firefox).
Best regards,
Rumen
the Telerik team