Hi
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your request. The same can be accepted to spans, if you would like to use Character Styles.
<html>
<head>
<style type="text/css">
.myStyle { font-size:16pt; font-weight:bold; font-style:italic }
.myCharStyle { font-size:10pt; font-weight:bold; }
</style>
</head>
<body>
<div>
<h1><span>This is heading 1 style</span></h1>
<h2><span>This is heading 2 style</span></h2>
<h3><span>This is heading 3 style</span></h3>
<p>
<span>This is normal style </span>
<span class="myCharStyle">This is my character style</span>
</p>
<p class="myStyle"><span>This is my custom style</span></p>
</div>
</body>
</html>
Regarding hyperlinks, if you need to insert hyperlinks as a simple text, you can just remove hyperlinks from your HTML. For example, you can try using regular expressions to achieve this. Please see the following code:
// Read HTML string.
string html = File.ReadAllText(@"Test001\in.html");
// Replace hyperlinks in the HTML string with simple text.
Regex regex = new Regex("]*>(.*)", RegexOptions.Singleline | RegexOptions.IgnoreCase);
html = regex.Replace(html, "$1");
// Get HTML bytes and create stream.
byte[] htmlBytes = Encoding.UTF8.GetBytes(html);
MemoryStream htmlStream = new MemoryStream(htmlBytes);
// Create document from stream.
Document doc = new Document(htmlStream);
// Save output document.
doc.Save(@"Test001\out.doc");
Hope this helps.
Best regards.