Development tools for creating Office Add-ins on Windows and Mac.
office-addin aims to reduce a few particular pain points related to Office Add-in development:
- Setup manifest for sideloading during development
- Generating an Add-in manifest
- Validating an Add-in manifest
- Logging and error handling in Add-ins
office-addin as a development dependency for your project.
npm install --save-dev office-addin
The most straight-forward way to call the
office-addin command-line tools is from package.json scripts.
The following is an example
scripts section of a project's package.json.
Initial setup for an Office Add-in can be extensive,
office-addin setup aims to make it a straightforward, simple process.
# Windows: Run as administratornpm run setup# Macsudo npm run setup
Setup performs the following steps:
- (Windows-only) Create
.addin-catalogfolder in User directory
- (Windows-only) Share
.addin-catalogfor access from Office
- Create symlink to Add-in manifest in catalog directory
- Generate development https certificates and register as trusted CA
- Instructions for loading add-in based on system type
Note: If manifest is generated after
setup has been run initially,
setup will need to be run again to create symlink of manifest.
office-addin generate is used to get you started with a valid Add-in manifest with required information completed.
Additionally, it can be used to create matching manifests that handle differences between development and production.
office-addin validate checks the project's manifest against Microsoft's Add-in schema
and verifies that the Add-in can be submitted to the Office Add-in Store.
office-addin can be used to output
errors to the command line.
There are two primary components to command line logging: server-side and client-side.
Server-side, attach the logging server to an existing node http server:
const server = ...const addinServer = ;addinServer;// Standalone (create server and attach to given port)addinServer;
Alternative, run a standalone logging server
Client-side, include office-addin (preferably before the project's js to catch compilation errors)
For details on usage with Webpack, Gulp, create-react-app, and other environments, see the examples.