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

Free Support Forum - aspose.com

Replace single characters in Range.Replace

Is there a way with Aspose Word to replace single characters. What I plan to do is replace each character of the document with some other character. Is that possible? Thank you.

Hi,


Thanks for your inquiry. Please refer to the following section of documentation:
https://docs.aspose.com/display/wordsnet/Find+and+Replace

In case you have any troubles, please attach the following resources here for testing:

  • Your simplified input Word document
  • Aspose.Words generated output DOCX file showing the undesired behavior
  • Please attach your expected document here for our reference. We will investigate the structure of your expected document as to how you want your final output be generated like. You can create expected document using Microsoft Word.
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you code to achieve the same by using Aspose.Words. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,

I have attached what I am trying to do. The project is big so I tried to simply the class a little bit. I am first using the doc.Range.Replace on the regex called CPSCRIPTING, then trying to replace “a” with “b”. This is not working as expected.

Hi Vlad,

Thanks for your inquiry. We are working over your query and will get back to you soon.

Best regards,

Hi Vlad,


Thanks for being patient.

Unfortunately, it is difficult to reproduce the exact same problem/scenario on our end by using the code/test files you provided. We need the following resources from your end to be able to completely understand and reproduce the problem with latest version of Aspose.Words for .NET 17.2.0:

  • Your simplified input Word document
  • Aspose.Words generated output DOCX file showing the undesired behavior
  • Please attach your expected document here for our reference. We will investigate the structure of your expected document as to how you want your final output be generated like. You can create expected document using Microsoft Word.
  • Please create a comparison screenshot highlighting (encircle) the problematic areas in this Aspose.Words generated output DOCX (with respect to your expected document) and attach it here for our reference
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start further investigation into your issue and provide you code to achieve the same by using Aspose.Words. Thanks for your cooperation.

Best regards,

I have resolved the issue. You can close this.

Hi Vlad,


It is great you were able to find what you were looking for. Please let us know any time you have any further queries.

Best regards,