For your request there are a two solutions, depending on a way you want to achieve your goal.
If you consider a whole paragraph a single line, then you can use Paragraph::Words collection, which is stored inside of Paragraph object and decide if you want to see the current paragraph in the output by iterating through Paragraph::Word objects, looking for keywords.
If you wish to work with lines, as they appear in original file, then you can try using Paragraph::Lines collection which is also stored in Paragraph object. In this case we suggest this way:
From IParagraph object get Lines object.
Iterating through Lines object, use information in it to determine characters, that belong to the specific line, so that you could check if this line contains keywords.
Depending on does it contain keywords or not, you can act accordingly (e.g. deleting lines without keywords via Paragraph::Remove method).
More info about Paragraph object see at Help → API Reference → Layout-Related Objects → Paragraph.
Comments
1 comment
Hello,
For your request there are a two solutions, depending on a way you want to achieve your goal.
If you consider a whole paragraph a single line, then you can use Paragraph::Words collection, which is stored inside of Paragraph object and decide if you want to see the current paragraph in the output by iterating through Paragraph::Word objects, looking for keywords.
If you wish to work with lines, as they appear in original file, then you can try using Paragraph::Lines collection which is also stored in Paragraph object. In this case we suggest this way:
More info about Paragraph object see at Help → API Reference → Layout-Related Objects → Paragraph.
Please sign in to leave a comment.