I have a shell script that takes one text argument and returns an image from that. I want to add this to word ribbon bar as a button and replace the selected text with the image produced by the script (basically copy-paste). What is the best way to do it?
- create c# word add-in and manually add it to add-in ribbon
- create vba add-in and create word.ribbonui xml
- create macro and ...
- use windows com as passing messages and create client-server system
- use activeX
- something else
- some different combination of the above
Also, if you have some tutorial or pseudocode how to do it in practice it would be helpful. I am not looking a complete answer just some tips where should I start.
The script is python and word is 2010. Additional bonus is, if it is possible to package for distribution (some GPL style license).
EDIT:
Some things that I have learned...
- ActiveX belongs to COM (component object model) group
- you need visual studio 2010 pro in order to have c#/vba office developement tools
- there exists "excelAddin.py" google that uses win32com, and works after a few tweaks
- there exists a win32con.WM_GETTEXT and WM_GETSEL messages: see How to retrieve the selected text from the active window
Next: put all together, and write the answer...
related stuff:
the whole code (originally in codereview): How can I register the code with different clsid?
possible help to the final issue: