Include class attributes and embedded css in word to html conversion

I need aspose words (java) to match Microsoft inclusion of class attributes and embedded css in the HTML file from a Word .doc a Word .docx conversions.

Excerpts from an example follows

Aspose generated excerpt: with no css:

		<p style="margin-top:0pt; margin-left:46pt; margin-bottom:0pt; text-indent:-36pt; page-break-inside:avoid; page-break-after:avoid; font-size:11pt">
			<span style="width:21.39pt; text-indent:0pt; display:inline-block; -aw-tabstop-align:right; -aw-tabstop-pos:37.8pt">&#xa0;</span><span style="font-family:'Times LT Std'">I.</span><span style="width:8.2pt; text-indent:0pt; display:inline-block">&#xa0;</span><span style="font-family:'Times LT Std'">The alleles for linked genes may recombine due to crossing over.</span>
		</p>

Microsoft word generated HTML excerpts
p.PPTBaseStyle, li.PPTBaseStyle, div.PPTBaseStyle
{mso-style-name:PPTBaseStyle;
margin:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:“Times LT Std”,serif;}

I. The alleles for linked genes may recombine due to crossing over.

The following from a previous may 31, (Word to HTML - Style name) forum posting works:

HtmlSaveOptions HtmlSaveOptionsObj = new HtmlSaveOptions(SaveFormat.HTML);
HtmlSaveOptionsObj.setCssStyleSheetType(1);//embeded inside html
wordDocument.save(OUTPUTHTMLFILEPath+".html", HtmlSaveOptionsObj

I previously tried this approach with similar code but have not identified the difference.

@wanjab

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output HTML file that shows the undesired behavior.
  • Please attach the expected output HTML file that shows the desired behavior.
  • Please create a simple Java application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.