Can an external application make a call to an Office application, and cause it to fire off a method that generates a document?
An example scenario would be the following:
Rather than performing 1) in Application A, and then going over to Word to perform 2) we want to invoke 2) at the end of the script that generates the JSON.
This question from 2016 raises a similar question, but for Excel
there is an "Open in Office" pattern where you can generate Word/Excel/PPT files from your application. These files should contain a reference to your add-in. In addition, you can use the document settings OOXML to save state, which you add-in can then read on initialization.
We recently showed a new pattern and practice sample here that would be worth checking out in detail how to apply this pattern. It says "Open in Excel" but it can be applied more broadly and the code sample works in Word as well.
See here for specific details: https://aka.ms/openinexcelpnp. We'll be evolving that to include a more end to end examples and make it also generic to Word and PowerPoint use cases as well.
thanks!