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

Free Support Forum - aspose.com

Search for text and add text after

Hi everyone! I’m trying to search for a specific text in a word document and add text after it. How is possible in c# ?
Thanks a lot in advance!

@Silvering

Thanks for your inquiry. Please check following example, you can use IReplacingCallback to search and add text. Hopefully it will help you to accomplish the task.

https://docs.aspose.com/words/net/find-and-replace/

ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
{
    e.Replacement = e.Match.ToString() + " Test";
    //e.Match.ToString() + mMatchNumber.ToString();
    return ReplaceAction.Replace;
}

Best Regards,