Word
1.6.5The Glue42 Word Connector allows applications to use MS Word as a document editor. The application sends document 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 application to display and/or store in the backend where it can be properly secured and audited.
Summary of features:
- The HTML document is sent to the application every time the user saves the document.
- Images may be embedded within the document HTML, 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 application. The original objects can be preserved in Microsoft
DOCX
format, however, and can be saved to the backend so the user can edit the document later. - Documents are created in the folder
%APPDATA%\Tick42\GlueWordPad\Files
(configurable).
See also the Word Connector documentation for more details.
APIobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
addinStatus | boolean | Word addin status |
||
all | DocumentApi[] |
Methods
onAddinStatusChangedmethod
Signature
(callback: (args: { connected: boolean; }) => void) => void
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (args: { connected: boolean; }) => void |
Example
glue4office.word.onAddinStatusChanged(({ connected }) => {
console.log(connected);
if (connected) {
glue4office.word
.openDocument(options)
.then(console.log)
.catch(console.warn);
} else {
console.log("Word is closed");
}
});
openDocumentmethod
Signature
(config: OpenDocumentConfig) => Promise<DocumentApi>
Parameters
Name | Type | Required | Description |
---|---|---|---|
config | OpenDocumentConfig |
Example
var options = {
name: "MyFirstDocument",
data: "<html><h1>Hello world!</h1></html>",
isDocx: false
};
glue4office.word
.openDocument(options)
.then(console.log)
.catch(console.warn);
readymethod
Signature
() => Promise<object>
DocumentApiobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
data | string | |||
name | string |
Methods
getHtmlmethod
Signature
(callback: (html?: string) => void) => Promise<string>
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (html?: string) => void |
onChangedmethod
Signature
(callback: (html: string, docx?: string) => void) => UnsubscribeFunction
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (html: string, docx?: string) => void |
onClosemethod
Signature
(callback: () => void) => UnsubscribeFunction
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | () => void |
OpenDocumentConfigobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
data | string | |||
isDocx | boolean | |||
name | string | |||
templateName | string |