Giter VIP home page Giter VIP logo

office-addin's Introduction

office-addin

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:

  1. Setup manifest for sideloading during development
  2. Generating an Add-in manifest
  3. Validating an Add-in manifest
  4. Logging and error handling in Add-ins

Installation

Install 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.

{
  "scripts": {
    "setup": "office-addin setup",
    "generate": "office-addin generate",
    "validate": "office-addin validate"
  }
}

Setup

Initial setup for an Office Add-in can be extensive, office-addin setup aims to make it a straightforward, simple process.

# Windows: Run as administrator
npm run setup

# Mac
sudo npm run setup

Setup performs the following steps:

  1. (Windows-only) Create .addin-catalog folder in User directory
  2. (Windows-only) Share .addin-catalog for access from Office
  3. Create symlink to Add-in manifest in catalog directory
  4. Generate development https certificates and register as trusted CA
  5. 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.

Generate

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.

Validate

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.

Logging

office-addin can be used to output console.log and 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 = require('office-addin/server')();
addinServer.attachTo(server);

// Standalone (create server and attach to given port)
addinServer.attachTo(8080);

Alternative, run a standalone logging server

{
  "scripts": {
    "start": "office-addin server"
  }
}

Client-side, include office-addin (preferably before the project's js to catch compilation errors)

import 'office-addin';

For details on usage with Webpack, Gulp, create-react-app, and other environments, see the examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.