Skip to main content

@interopio/office

1.8.0-beta.1

The @interopio/office library allows your web apps to interoperate with Microsoft Office apps like Outlook, Word, and Excel.

Library Usage

The @interopio/office library is available as an NPM package and is also distributed as JavaScript files with io.Connect Desktop.

To install the @interopio/office library, execute the following command:

npm install@interopio/office

You can now import the factory function exposed by the library:

import IOConnectOffice from "@interopio/office";

You can also reference the library as a JavaScript file in the HTML file of your web app by using a <script> tag:

<script type="module" src="./office.min.js"></script>

Initialization

The @interopio/office library exposes a global factory function called IOConnectOffice() which you must invoke to initialize the library in your app. The factory function accepts an optional Config object which you can use to configure various features of the library.

import IOConnectOffice from "@interopio/office";

// Optional configuration for the library.
const config = {
    // Disabling the Excel and Word APIs.
    excel: false,
    word: false,
};

// Initializing the library and obtaining a reference to the API object.
const office = await IOConnectOffice(config);