Search code examples
searchreplacecomaspose

Open Office document at a specific word and highlight it


is there any way I could open an office document (Word, excel) with the cursor position at a specific string that is given as input ?

The requirement is part of a search and replace functionality and the client would like to open a document with the cursor positioned at the first occurrence of the search term. Highlighting it as well if possible. I have tried researching for this, but didn't find any helpful resources.

We are using Aspose and the Component Object Model (COM)

Help would be much appreciated!


Solution

  • It is possible to search text using Aspose.Words and Aspose.Cells. You can also highlight the searched term in the search results. For example you can search in an excel document using Worksheet.Cells.Find() method. Once cell is found, it could be highlighted with any color using Cell.SetStyle() method. Please visit the following links for details on how to search and highlight text using Aspose.Words and Aspose.Cells:

    I work with Aspose as Developer evangelist.