OfficeDev/Word-Add-in-JavaScript-SliceDataChunks

Name: Word-Add-in-JavaScript-SliceDataChunks

Owner: Office Developer

Description: Shows how to use JavaScript in a Word 2013 task pane add-into get the current document and slice it into chunks of data.

Created: 2015-08-18 17:55:21.0

Updated: 2018-04-11 22:15:20.0

Pushed: 2018-01-31 20:24:54.0

Homepage: null

Size: 945

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Word Add-in: Send a Word document in chunks to a service

Table of contents

Summary

This sample shows how to use JavaScript in a Word 2013 task pane add-in to get the current document and slice it into chunks of data in user-defined sizes. The data could then be submitted to a service (such as an editing service, a translation service, or an e-book publishing service).

Prerequisites

This sample requires the following:

Key components of the sample

The sample solution contains the following key files:

WordDocumentEmitter project

WordDocumentEmitterWeb project

Description of the code

The DocumentForEditing.docx file is set as the Start Document property of the task pane add-in. The document is large enough (500 pages) to be sliced into a number of discrete chunks of data.

The sample demonstrates:

Build and debug
  1. In Visual Studio, press F5 to build and deploy the sample add-in.
  2. On the Home ribbon, click Open in the Document Slicer group.
  3. In the task pane add-in, choose a size for the data chunk.
  4. Click the Publish now! button.

The add-in displays the number of slices and the size of each slice, along with buttons you can use to view the content of each slice.

This sample displays the slice information to the user, but your add-in will probably send the data slices to a web service. The web service can then rebuild the presentation from the slices.

Troubleshooting

Questions and comments

Additional resources
Copyright

Copyright (c) 2015 Microsoft. All rights reserved.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.