THB, I have no idea what that API / library is, but even without knowing what it is, I think I can safely say that you don’t need it.
You can run LanguageTool as a server on your local machine and send queries to it via HTTP. This is exactly how the extension for Firefox works. You send an HTTP request and the server returns XML. I haven’t tried out other plugins, such as the one for Open Office, but I suspect they work the same way.
If this is true, then I see no reason why it wouldn’t be possible to program an add-in for literally any application that queries the local server the same way. I’ve written Office add-ins that query remote servers using HTTP. Why wouldn’t it work with a local server?
yes, you could contact a local server. The LibreOffice version doesn’t do that but that’s also because we first had the LibreOffice/OpenOffice integration and only later the HTTP service I think.
I have made some tests with an add-in for Microsoft Word using a LanguageTool server, and I plan to resume this work during the month of December. If we share the same goal, we could work together.
The easy part for me is the use of the LanguageTool API, which I am familiar with.
The MS Word interface is not so easy for me. There are different options regarding how to show the errors, and I have not decided what to use. A dialog box seems easy to implement but it is less useful, I think. Underlined words plus context menu (which I have tried to do) is quite tricky to implement. Another option is to show the results in a side panel (like in the Chrome LanguageTool add-on).
Another challenge is what to do with long documents. It would be desirable to analyze the text dynamically someway so that the user can always see the current page analyzed with LT without a long wait. But probably this is beyond the scope of a first version.
I will post my code on GitHub. Any idea or any contribution is welcomed.
I read up on the CGAPI mentioned at Missing Features - LanguageTool Wiki (as well as the CSAPI), and I think I understand now why using this API is difficult. Microsoft isn’t being very generous with information on it.
Nevertheless, it seems to be the only way to implement a spelling / grammar checker in Office that will underline the words and phrases in a document as you type.
Have you already tried to apply for the SDK from Microsoft? If not, do you think we should give it a try?
I am looking at alternatives and may have something to post a little later.
I followed the link, signed in and tried to download the app, but I’m not using Office Live, 365 or 2016, so I’m going to have trouble getting / evaluating it. I read that Office has a new Javascript API, so that does indeed sound interesting.
Are you familiar with this addon? Is this a competitor to LT?
I was doing some searches today also, and I found the following two projects on Code Project:
I have tried to write an add-in for Ms Word 2010 using VSTO (Visual Studio Tools for Office) in C#. This add-in could be used in several versions of Ms Word: 2007-2013.
Here you can see some of my code:
This is not working yet. I’m able to underline words with different colors using the LanguageTool results, but the dropdown menu with suggested replacements is not implemented. It’s too difficult for me, and I’m giving up for now.
I would like to implement something like a dialog box or a pane, which seems easier. There is a lot of information about this in the web. Perhaps too much information. A working example would be the best help.