Word to HTML - Style name as @class

Hi, I using Aspose.Word with Java. I save the Word document to HTML. My Word document is well styled using the Microsoft Word’s Paragraph and Character styles. Is there any way can I get the Paragraph and Character names as is into the HTML @class attribute or any other attribute? At present, all the properties of Paragraph and Characters are transformed into @style attribute.


Hi, Fortunately, I could find the solution. Just by adding configuration parameters I can get what I look for.

Here is the code for the same.

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


It is nice to hear from you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.