Hello,
I’m currently evaluating Aspose.Words (24.7.0) to create a ‘Word - Search and Replace Text’ function, I have also tried the latest version of the library. Unfortunately, the FindReplaceOptions()
class is a bit temperamental depending on the document in which I use. When I replace text with existing font styling such as underline or italic and set the relevant save option to false it does not replace the text with no replacement save option set, but instead inherits the original formatting. So as an example, if the searched text is found which is underlined and I replace the text with the findReplaceOptions.ApplyFont.Underline = Underline.None
set then the underline remains present even though the text has been updated correctly.
Please see my console app image, and two attached Word Documents.
When using TestSmallDoc.docx as input, it appears to output correctly, apart from ‘Shadow’ and ‘Outline’, all the other options work as intended.
When using TestLargeDoc.docx I’ve found that none of the highlighted text is replaced with text that has no styling (underline, italic etc.) when I set the save options to false.
Please advise how I can resolve this?
Kind regards,
djs
TestLargeDoc.docx (69.4 KB)
TestSmallDoc.docx (13.7 KB)