CSS property mso-style-name not supported

We are using Aspose.Words for Java 19.7.

We are trying to apply a word style to a paragraph using the CSS style property mso-style-name that is used by word, but it doesn’t work. Here’s the code:

Document document = new Document();
DocumentBuilder builder2 = new DocumentBuilder(document);
builder2.insertHtml("<p style='mso-style-name: \"Heading 1\"'>Test</p>");
document.save("result.docx");

Is this not supported? Furthermore, is there a list of CSS properties that Aspose.Words supports?

documents.zip (14.1 KB)

@bmpi,

Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have logged this feature request as WORDSNET-18975 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

Okay, thank you. We have noticed that it works if the style is specified as a class, e.g.

<p class="Heading 1"></p>

The space should be illegal in a class name, yet it works. Among other things it does not apply the font size of the style, which is weird.

What about my second question? Is there a list of CSS properties Aspose.Words supports, e.g. margin-left?

@bmpi,

Aspose.Words does support all CSS. However, MSO styles are not supported by Aspose.Words.

Please read the following article about supported styles.
Style Features Supported on HTML Import