Add comments to the specific text

Hi @awais.hafeez
Can you please suggest me,
How can we use this functionality for multiple comments.
Thank you!

@cpai.sachin Could you please elaborate your requirements in more details? Also, please provide you input and expected output documents. This will help us to better understand your requirements.

The code provided in the referenced thread adds comment to the specific text in the document.

Hi @alexey.noskov Thank you for your reply.
Yes I want the same functionality as given in the referenced thread.
But We have multiple comments that need to be find and replace in the document, how can we achieve that in one go using IReplacingCallback.
Thank you!

@cpai.sachin The provided code adds comment to specific text. If you need to get comments from your document, you can simple get Comment nodes from it. Please see our documentation to learn how to work with comments:
https://docs.aspose.com/words/net/working-with-comments/

Hi @alexey.noskov I am agree that, provided code add only single comment to specific text once. same way I want to add multiple comment with different different specified text as mentioned in the snapshot on one go.

Thank you!

@cpai.sachin the code demonstrates the basic technique. You can adjust the code to match different words/text in your template. For example, you can use regular expression. The same way you can adjust code to insert comment according to the matched text.

Thanks @alexey.noskov.

1 Like