Hello Tahir,
I understand perfectly your point and the purpose of StyleIdentifier.
However, when I generate a document with my generator, I don’t know in advance which styles the documents will contain. The user of my generator can choose any style he wants for each paragraph/etc.
So, indeed, the final document will not contain all the built-in styles. But if the only method to create a built-in style with Aspose.Word is to load a .docx file with the specified style embedded, this file must contain all the styles to be able to get them afterwards.
Maybe I just didn’t understand what you told me, but here’s what I understood. If I want to create a Heading-1 style (for example) in a document, I must create a .docx file using MS.Word, then in this document use the Heading-1. After that, with Aspose.Word, I load this file, get the Heading 1 style, copy this style from the loaded file to the document I am generating, and then use it. It is clearly not convenient. I can’t do this for every style I may need in a document.
Using the getStyleByIdentifier method, even if it is not a expected use of the method provides me a simple, easy way to do that : if it exists in the document, it gets it, and if it doesn’t, it creates and puts it inside. Having to create a document using MS.Word with all styles embedded is clearly not a convenient method.If the getStyleByIdentifier method is not intented to do that, there is not another method to do that ?
Finally, using your definition “note heading” is a built-in style.
As you can see on my printscreen, trying to create a new style with name “Titre de note” (which is french for “note heading”) returns the error message you send me. (Sorry, the picture is in french, my MS.Word version is in french)
Thank you in advance,
Jean-Pascal Lim