Skip to content

jthake/generator-office

 
 

Repository files navigation

Microsoft Office Project Generator - YO OFFICE!

npm version Downloads Build Status Coverage Status Dependency Status devDependency Status Slack Network

Yeoman generator for creating Microsoft Office projects using any text editor. Microsoft includes fantastic & rich development tools for creating Office related projects using Visual Studio 2013 or tools for Visual Studio 2015. This generator is for those developers who:

  • use a editor other than Visual Studio
  • interested in using a technology other than plain HTML, CSS & JavaScript

Like other Yeoman generators, this simply creates the scaffolding of files for your Office project. It allows you to create:

  • Office Mail Add-ins (both read & compose forms)
  • Office Task Pane Add-ins
  • Office Content Add-ins

Choose to create the Office projects using plain HTML, CSS & JavaScript (mirroring the same projects that Visual Studio creates) or create Angular-based projects.

Check out the announcement blog post: Office Dev Center Blog - Creating Office Add-ins with any editor - Introducing YO OFFICE!

Read up on how to use the generator to create Office Add-ins with Visual Studio Code.

If you are interested in contributing, read the the Contributing Guidelines.

YO Office Demo (screenshot & video)

<iframe width="560" height="315" src="https://www.youtube.com/embed/78b18BLVosM" frameborder="0" allowfullscreen></iframe>

Install

Install yo (Yeoman) and generator-office globally using NPM (this also requires Node.js. The project files created by the generator leverage client side packages in bower so you will want to install that as well:

$ npm install -g yo generator-office bower gulp

Usage

$ yo office [options]

The generator is intented to be run from within a folder where you want the project scaffolding created. This can be in the root of the current folder or within a subfolder.

Note: Office Add-ins must be hosted, even in development, in a HTTPS site. You can create a simple HTTPS hosted site using Node.js using the nodehttps generator.

Sub Generators

Running the main generator will prompt you for the type of Office project to create. This triggers the execution of one of the included sub generators. You can instead call one of these sub generators directly to bypass that question:

  • office:mail - creates a Mail Add-in
  • office:taskpane - creates a Task Pane Add-in
  • office:content - creates a Content Add-in

Remember you can see the options of each sub generators by running $ yo office:[sub] --help

Running the Generated Site

All generators create a gulpfile.js. This uses the gulp-webserver task to start a HTTPS server. This server includes a self-signed SSL cert that your development enviroment must trust (this involves adding it to your trusted root certificates). Start the local HTTPS site on https://localhost:8443/ and launch a browser to this site using:

$ gulp serve-static

You can add the open property set to a URL to have your default browser open & navigate to when running this task.

Examples

Refer to the docs for example executions & output of the generator.## Command Line Options:

List of supported options. If these are not provided, the generator will prompt you for the values before scaffolding the project.

For a full list of all options & descriptions, run yo office --help

--skip-install

After scaffolding the project, the generator (and all sub generators) run all package management install commands such as npm install & bower install. Specifying --skip-install tells the generator to skip this step.

  • Type: Boolean
  • Default: False
  • Optional

--name:'..'

Title of the project - this is the display name that is written the manifest.xml file.

  • Type: String
  • Default: undefined / null
  • Optional

--root-path:'..'

Relative path where the project should be created (blank = current directory). If specifying a subfolder, use a relative path. For instance, if you are currently in the MyProject folder specify src/public to create the addin in MyProject/src/public.

  • Type: String
  • Default: undefined / null
  • Optional

--tech:[ 'html' | 'ng' | 'manifest-only' ]

Technology to use for the project. The supported options include HTML (html) or Angular (ng). You can also use Manifest.xml only (manifest-only) which will create only the manifest.xml for an an Office addin.

  • Type: String
  • Default: undefined / null
  • Optional

--clients: [ 'Document' | 'Workbook' | 'Presentation' | 'Project' ]

The Microsoft Office client application that can host the add-in.

This applies only to task pane or content add-ins.

  • Type: String[]
  • Default: undefined / null
  • Optional

--outlookForm: [ 'mail-read' | 'mail-compose' | 'appointment-read' | 'appointment-compose' ]

The type of form within Outlook that can host the add-in.

This applies only to mail add-ins.

  • Type: String[]
  • Default: undefined / null
  • Optional

About

Yeoman generator for building Microsoft Office related projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 76.4%
  • JavaScript 22.6%
  • HTML 1.0%