Iterating through Document Styles - How?


#1

Hi, is there a way of iterating through the Styles in a document using Aspose.Word?

I can’t find an obvious way in the documentation, forums or Wiki’s.

Thanks for your help.

Steve Lewin


#2

Document Styles collection will hopefully be made available in one of the upcoming releases. At the moment it is only possible to enumerate through document paragraphs using IDocumentVisitor and figure out their StyleName or StyleIdentifier from the ParagraphFormat object.


#3

Thanks - I figured out a work-around by just attempting to set a paragraph style to the ones that I was interested in. When an error gets thrown I know the style does not exist. Bit clunky but it works!

Thanks
Steve