Here we are:
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
string _html =
@"
<html>
<head>
<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">
</head>
<body>
<div name=""divtagdefaultwrapper"" style=""font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0"">
<div class=""WordSection1"">
<p class=""MsoNormal"" style=""text-autospace:none"">
<span style=""font-size:11pt; color:rgb(31,73,125)"">
I am out of office, please contact Aaaaaa Bbbbbbb (Tel: +1-234-567-8900/email:
<a href=""mailto:aaaaaa.bbbbbb@zzz.com"">aaaaaa.bbbbbb@zzz.com</a>) for assistance
</span>
</p>
</div>
</div>
</body>
</html>
";
RadDocument _doc = htmlProvider.Import(_html);
radRichTextBox.Document = _doc;
And here is an exception:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.RichTextBox
StackTrace:
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.FillSpanProperties(SpanProperties spanProps, EvaluateProperty evalFunction, IEnumerable`1 disregarderdDefaultStyleBagPropertiesCollection)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.CreateSpanFromTextNode(INode childNode, Paragraph paragraph, IEnumerable`1 disregarderdDefaultStyleBagPropertiesCollection)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessContentNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass79_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass79_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass79_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.Import(Stream input)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Import(Stream input)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Import(String input)
at WpfTest.MainWindow.ButtonTest_OnClick(Object sender, RoutedEventArgs e) in C:\Users\mosvk\Source\Workspaces\Bm.Extensions\test\WpfTest\MainWindow.xaml.cs:line 191