MS Word plugin VSTO development

Job ID: 35122546

Budget: €18 – €36 EUR

We are developing a MS Word plugin in VSTO.

There are two tasks, in particular, we are facing issues with:

(1) Mapping text
Context: Our plugin analyses the text user wrote in MS Word. Similarly to Grammarly, we need to display the user information in the plugin panel, that relates to the text user wrote in the MS Word file. If the user, e.g. accepts a suggestion in the plugin, the text in the MS Word file needs to change as well. If the user clicks on a relevant button in the plugin, his cursor should be moved to that text in the file etc.

Problem: we analyse the text on our server and we know which word should be connected to which information / suggestion. However, we do not know, how to best specify the exact word to MS Word.

We have tried e.g. counting the characters on our end and then sending back the information on corresponding character ranges. That did not work, as MS Word does not give us the information on hidden characters, that MS Word however uses on its end (as described here https://stackoverflow.com/questions/56059261/word-vsto-get-text-of-document-with-hidden-characters )

(2) Overlay
Context: with the analysis of text we want to, in the same way as Grammarly does, “highlight” the text in MS Word, but without doing any actual changes to the text, that is only with displaying a graphic overlay.

Once we can reliably “map” the words we want to overlay (ie, once (1) is done), we want to implement the overlay. Described here [https://stackoverflow.com/questions/65587202/ms-word-object-model-custom-spellchecking-underlines](https://stackoverflow.com/questions/65587202/ms-word-object-model-custom-spellchecking-underlines)

The solution to (1) and (2) should also take into account that user is writing and editing the text when using the plugin, so that overlay does not break when the character ranges move.
Related categories: .NET C# Programming Microsoft Office