Microsoft Office
Overview
Just click a button to launch Microsoft Office apps from within the browser, pre-loaded with relevant data from the web app you are using! For example, if you are viewing portfolio data in an in-house web app, click "View in Excel" to bring up a new Excel window displaying the same data. If you edit and save this data in the Excel window, it is pushed back into the web app in real time. Data validation can be performed by the web app, but the continuous synchronization means that validation issues are instantly flagged in Excel.
The Microsoft Office Adapters allow you to:
Use Excel with its familiar functionality, such as macros and pivot tables, to create sophisticated calculations, or continue using those that may have accumulated over the years, while being able to save all data edits to your web app in real time.
Edit and format a document in Word, including WordArt, tables and drawings, making use of the familiar and powerful capabilities of the most popular text processing tool in the world.
Send and receive emails and manage tasks from web apps using all the familiar capabilities of Outlook.
If you are a developer working with users who love Excel, Outlook and Word, then the Microsoft Office Adapters will help you enable them to continue working with the apps they enjoy and prefer. The real time integration provided by io.Connect Desktop means that centralized control of data in the organization doesn't have to limit users to in-house web apps. Instead, they can benefit from the functionality and familiarity of the Microsoft Office desktop apps, without saving any data locally and being able to access all data from web apps as if they are still working in the browser.
Enabling the Adapters Manually
Generally, all Application Adapters for Microsoft Office that are shipped with io.Connect Desktop are automatically enabled. In some cases, however, a Microsoft Office app may disable or deactivate the respective Application Adapter due to internal settings, policies, etc. To manually enable or activate the Application Adapter, you have to open the app, go to File/Options/Add-ins
and see whether the Application Adapter is among the inactive or disabled add-ins. If so, you have to enable or activate it manually by selecting COM Add-ins
(if the Adapter is inactive) or Disabled Items
(if the Adapter is disabled) from the Manage
dropdown menu:
Library Usage
This guide explains how to reference and initialize the @glue42/office
library in your web app so it can interoperate with any of the Microsoft Office products supported by io.Connect Desktop.
After completing the steps in this guide, you can read the respective development guides to learn how your app can interact with specific Microsoft Office products.
To be able to use the functionalities provided by the library, you must have io.Connect Desktop and the respective Application Adapters installed.
Referencing
The @glue42/office
library is available both as an NPM module and as a standalone JavaScript file in <installation_location>/interop.io/io.Connect Desktop/SDK/ioOfficeJS/js/web-bundle
.
You can reference the library in a <script>
tag:
<script type="text/javascript" src="office.min.js"></script>
The browserified JavaScript file is also a CommonJS module, which you can require
/import
.
CommonJS:
const Glue4Office = require("@glue42/office");
ES6:
import Glue4Office from "@glue42/office";
Initialization
When you reference the standalone JavaScript file, it will expose a global factory function called Glue4Office
.
If you have imported or required the library, the function will be available with the name you specified in the import
or require
statement.
Assuming you stick to the default Glue4Office
name, to initialize the library, you need to call the function Glue4Office and specify which Microsoft Office apps you want to interoperate with. The function returns a Promise
, which will resolve with an initialized instance of the library.
Example:
const officeConfig = {
application: "Microsoft Office Interop",
excel: true, // enable Excel interop
word: true, // enable Word interop
outlook: false // disable Outlook interop
}
Glue4Office(officeConfig)
.then(office => {
// office is a reference to the @glue42/office API
window.office = office; // expose office as a global variable
// use office
})
.catch(console.error)
If your app is already loading io.Connect, you can initialize @glue42/office
by passing an initialized io.Connect library instance in the configuration object:
IODesktop()
.then(io => {
window.io = io; // expose io as a global variable
const officeConfig = {
glue: io,
excel: true, // enable Excel interop
word: true, // enable Word interop
outlook: false // disable Outlook interop
}
return Glue4Office(officeConfig)
})
.then(office => {
// office is a reference to the @glue42/office API
window.office = office; // expose office as a global variable
// use office
})
.catch(console.error)
Once you have obtained an initialized reference, you can start interacting with the Microsoft Office Adapters:
office.excel.openSheet(...);
office.word.openDocument(...);
office.outlook.newEmail(...);
The best place to render your app is when the Promise
is resolved (in the then
clause above). You would typically expose a global reference to the library and then render your app.
React Example
Glue4Office(officeConfig)
.then(office => {
window.office = office; // expose office as a global var
ReactDOM.render(
appElement,
document.getElementById("root"));
});
Angular Example
Glue4Office(officeConfig)
.then(office => {
window.office = office; // expose office as a global var
platformBrowserDynamic().bootstrapModule(AppModule);
// or
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
});