This is a Firefox add-on that consists of a library written in C++ that communicates with Microsoft Word out of process using OLE Automation, a js-ctypes wrapper for said library, and a template that is installed into Microsoft Word to communicate with Zotero.
build/zoteroWinWordIntegration/zoteroWinWordIntegration.sln
imports.h
to point to the appropriate files (may be in different places with newer Office)build/template/unpack_templates.sh
Start by opening the dotm/dot template in Word. Word templates have support for custom macros and adding UI elements to call the macros, which is how the extension is implemented on Word. RibbonUI can be edited by extracting the dotm file or using the Custom UI editor. To edit the .dot template UI Word for Windows 2003 is needed. In VBA macro code you will find that SendMessage protocol is used to issue commands to Zotero process from Word. These commands are received in zotero-service.js where they are passed to integration.js.
Zotero talks to Word via js-ctype bindings to a C++ OLE Automation based library. To generate new interfaces for Word interop communications you should use the Add New Class wizard in Visual Studio and select 'MFC Class from Typelib'. The interop API docs can be found in the MSDN. The plugin should technically work with Word versions starting with 2003, but we have stopped supporting everything below Word 2010 due to impossible to fix bugs cropping up as time goes on and Microsoft drops compatibility themselves. Some API calls are on a deprecation path, so we may be inevitably be forced to move away or split the library into multiple DLLs.