GithubHelp home page GithubHelp logo

worldox / word-add-in-sillystories Goto Github PK

View Code? Open in Web Editor NEW

This project forked from officedev/word-add-in-sillystories

0.0 3.0 0.0 151 KB

Learn how to load docx files from a NodeJS server and insert them into an open Word document.

License: Other

JavaScript 77.08% CSS 14.01% HTML 8.92%

word-add-in-sillystories's Introduction

Silly stories Word add-in sample: load files and use content controls

This Word add-in will show you how to:

  1. Load a list of docx files from a service and populate a drop down box control with the file names as options.
  2. Load a docx file from the service and insert it into the Word document.
  3. Load the content control collection and create input boxes based on the content controls.
  4. Update the text value of the content control collection based on the values in the input boxes.
  5. Use Office UI Fabric to create a seamless Word user experience.

Note: A giggle is a side effect of running this sample.

Prerequisites

To use the Silly stories Word add-in sample, the following are required.

  • node.js to serve up the docx files.
  • npm to install the dependencies.
  • JQuery, for the Office UI Fabric dropdown component.
  • Word 2016, or any client that supports the Word Javascript API. This sample does a requirement check to see if it is running in a supported host.

Start the web application

  1. Install project dependencies with Node's package manager (npm) by running npm install in the project's root directory on the command line.
  2. Start the development server by running node server.js in the project's root directory. The add-in will be running at 127.0.0.1:8080.

Configure and run on Word for Mac 2016

  1. Create a folder called โ€œwefโ€ in Users/Library/Containers/com.microsoft.word/Data/Documents/
  2. Put the manifest in the wef folder (Users/Library/Containers/com.microsoft.word/Data/Documents/wef)
  3. Open Word 2016 on the Mac and click on the Insert tab > My Add-ins drop down. You should see the add-in listed in the drop down. Select it and it will load the add-in.

Configure and run on Word for Windows 2016

  1. Create a network share, or share a folder to the network and place the word-add-in-sillystories.xml manifest file in it. You've deployed your add-in at this point. Now you need to let Word know where to find the add-in.
  2. Launch Word and open a document.
  3. Choose the File tab, and then choose Options.
  4. Choose Trust Center, and then choose the Trust Center Settings button.
  5. Choose Trusted Add-ins Catalogs.
  6. In the Catalog Url box, enter the network path to the folder share that contains word-add-in-sillystories.xml and then choose Add Catalog.
  7. Select the Show in Menu check box, and then choose OK.
  8. A message is displayed to inform you that your settings will be applied the next time you start Office. Close and restart Word.

Now you are ready to run it in Word.

  1. Open a Word document.
  2. On the Insert tab in Word 2016, choose My Add-ins.
  3. Select the Shared folder tab.
  4. Choose Silly stories add-in, and then select Insert.
  5. The add-in will load in a task pane. See figure 1 to see how it will look when it gets loaded.
  6. Select a story, to have boilerplate text entered into the Word document.

Figure 1. The Silly stories add-in loaded in Word

Picture of the Word application with the Silly stories add-in loaded

Questions and comments

We'd love to get your feedback about the Silly stories Word add-in sample. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about add-in development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [office-js], [word], and [API].

Learn more

Here are more resources to help you create Word Javascript API based add-ins:

Copyright

Copyright (c) 2015 Microsoft. All rights reserved.

word-add-in-sillystories's People

Contributors

michaelmainer avatar

Watchers

James Cloos avatar  avatar Ken Newton avatar

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.