We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Identifying a not built-in style

Hello,

I want to identify every style contained in a document. However, the methods style.getStyleIdentifier() only returns 4094 for a style not built-in. Is there any method which can allow me to identify a style among the list of styles of the document ?

Thank you
Jean-Pascal Lim

Hi Jean-Pascal,


Thanks for your inquiry. Please use the Style.getBuiltIn method to check either a style is built-in or not. The method return True if a style is one of the built-in styles in MS Word. Hope this answers your query. Please let us know if you have any more queries.

Document doc= new
Document(MyDir+“in.docx”);
<o:p></o:p>

for (Style style : doc.getStyles())

{

if(style.getBuiltIn())

{

System.out.println(style.getName());

}

}