Word

1.6.5

The 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, or JPEG.
  • 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.

object

(config: OpenDocumentConfig) => Promise<DocumentApi>

Parameters

Name
Type
Required
Description

config

yes

Returns

Promise<DocumentApi>

Example

var options = {
  name: "MyFirstDocument",
  data: "<html><h1>Hello world!</h1></html>",
  isDocx: false
};
glue4office.word
  .openDocument(options)
  .then(console.log)
  .catch(console.warn);
methodready
() => Promise<object>

Returns

Promise<object>

(callback: (args: { connected: boolean; }) => void) => void

Parameters

Name
Type
Required
Description

callback

(args: { connected: boolean; }) => void

yes

Returns

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");
  }
});

Properties

boolean

Word addin status

object

Properties

string

string

string

boolean

object

methodonClose
(callback: () => void) => UnsubscribeFunction

Parameters

Name
Type
Required
Description

callback

() => void

yes

Returns

UnsubscribeFunction

methodgetHtml
(callback: (html?: string) => void) => Promise<string>

Parameters

Name
Type
Required
Description

callback

(html?: string) => void

yes

Returns

Promise<string>

methodonChanged
(callback: (html: string, docx?: string) => void) => UnsubscribeFunction

Parameters

Name
Type
Required
Description

callback

(html: string, docx?: string) => void

yes

Returns

UnsubscribeFunction

Properties

string

string