Microsoft Office
Overview
The io.Connect Word Adapter allows apps to use Word as a document editor. The app is able to send text and images to Word in the form of HTML, so that the user may edit it using a familiar tool. When the user saves the changes, a new HTML document is created and sent back to the app to display or store in the backend where it can be properly secured and audited.
The Word Adapter enables your app to interact with Word in the following ways:
- The HTML document is sent to the app every time the user saves the document.
- Images may be embedded within the HTML document, as long as they are in one of the following formats:
PNG
,ICO
,BMP
, orJPEG
. - Embedded objects, such as images, charts and spreadsheets can be added to the Word document, but these will be converted to inline HTML images before they are returned to the app. The original objects can be preserved in Microsoft
DOCX
format and saved to the backend so the user can edit the document later. - Documents are created in the
%AppData%/Tick42/GlueWordPad/Files
folder which is configurable.
io.Connect Tab in the Word Ribbon
The io.Connect Word Adapter adds an "io.Connect" tab in the Word ribbon which you can use to manually send the current Word document to you interop-enabled apps by pressing the "Send Document" button:
To be able to receive and manage the Word document in your interop-enabled app, you must register an Interop method with a specific object type in the method definition.
The following example demonstrates using the io.Connect JavaScript API to register an Interop method for handling Word documents:
// It's required to use this object type in order to be able to receive and manage Word documents.
const objectTypes = ["WordPadReceiver"];
// Method definition.
const definition = {
name: "MyDataHandler",
objectTypes
};
// Method handler.
const handler = (result) => {
// Retrieving the name and the HTML representation of the Word document.
const { displayName, html } = result;
console.log(`Document "${displayName}":\n${html}`);
};
await io.interop.register(definition, handler);
It's possible to register multiple Interop methods for handling Word documents. If you register multiple methods, each from a different app, they can have the same or different names. If you register multiple methods from the same app, they must have different names. All registered methods must use the "WordPadReceiver"
object type. To select a target app to which to send the Word document, use the dropdown menu in the "io.Connect" tab. The menu displays all available Interop methods for handling Word documents and the names and instance IDs of the app instances that have registered them: