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

Free Support Forum - aspose.com

How to Find and Replace in Word using .NET

I tried to use ReplacingArgs in Aspose.Words. The match node property returns text that correspond half from what is present in the match property. The other half is a mid sentence existing in the text but not a piece of text present in the match property.

Exemple, I have two sentences (original text):

I love summer. It's beautiful. What a day !

Match (what we have in property match): I love summer. It's beautiful.

Expected: It's beautiful. -> Highlighted from I to period.

Actual result: It's beautiful. What a day ! -> run of text returned

How to Find and Replace in Word to have the good piece of sentences?

@LBlb

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.