How to quickly find the document's content by style?


for example: i want to find the document's title, headings and so on, no only search by content but also by style, can aspose.words support it?
Hi Pyntia,

Thanks for your inquiry.

Please note that formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting 1) to Run nodes by using Character Styles e.g. a Glyph Style, 2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles) and 3) you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

Please use the ParagraphFormat.Style gets or sets the paragraph style applied to this formatting. Please read following documentation link for your kind reference.
http://www.aspose.com/docs/display/wordsnet/How+to++Extract+Content+Based+on+Styles

To find the contents from document, you can achieve this by implementing IReplacingCallback interface. Please use the same approach shared at following documentation link to find the contents.
http://www.aspose.com/docs/display/wordsnet/How+to+Find+and+Highlight+Text
http://www.aspose.com/docs/display/wordsnet/Find+and+Replace+Overview


hi, tahir


thank you very much

Hi Pyntia,


Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.