Plug-in (Function & Smart Service)Free

Docx Tools

by Appian Corporation

Description

Create an un-protected copy of a protected DOCX document

Features

Smart Service CreateUnprotectedCopyDocx: Create Unprotected Copy Of DOCX Smart Service ExtractCommentsFromDocx2: Extracts all comments from a DOCX file and returns them as a JSON tree. Supports threaded replies, resolved status, and anchor text (the text highlighted when the comment was created). Smart Service ExtractEmbeddedDocumentsAndImagesFromDocx: Extracts all embedded documents and images from a DOCX file and saves them as Appian documents in a specified folder. Smart Service InspectTrackChangesFromDocx: Inspects a DOCX file to determine whether track changes recording is currently enabled and whether there are any pending unaccepted changes. Smart Service ExtractUrlsFromDocx: Extracts all unique URLs from a DOCX file. Covers all ways a URL can exist in a Word document Function extractTrackedChanges: Extracts tracked changes from DOCX and DOC files. The changes are returned in a JSON array.

Release notes

Summary

New inputs on function plugin to extract tracked changes from both DOCX and DOC files.

New Function

1. extractTrackedChanges

Extracts all tracked changes from a DOCX or DOC File

Inputs:

  • document (Document): the DOCX or DOC file to extract tracked changes from
  • coalesceAdjacentChanges (Boolean): Optional. When true (default), consecutive changes in the same paragraph that share the same type, author, and date are merged into a single record. Word often fragments one logical edit into many adjacent runs; coalescing collapses that noise. Set to false to return one record per raw run.
  • startingString (Text): Optional. Start of a search window. When provided, only changes at or after the paragraph containing the first occurrence of this string are returned. Leave blank to start from the beginning of the document
  • endingString (Text): Optional. End of a search window. When provided, only changes up to and including the paragraph containing the first occurrence of this string (at or after startingString) are returned. Leave blank to run to the end of the document

Outputs: Returns a JSON array with the following structure:

{
"id": 1,
"changeType": "INSERTION",
"author": "Jane Doe",
"date": "2024-03-15T09:30:00Z",
"changedText": "the inserted or deleted text",
"changedTextTruncated": false,
"charCount": 29,
"prefixAnchor": "text immediately before the change",
"suffixAnchor": "text immediately after the change",
"paragraphIndex": 0,
"runIndex": 0,
"originalParagraph": "the paragraph as it reads with the change rejected",
"updatedParagraph": "the paragraph as it reads with the change accepted",
"originalParagraphTruncated": false,
"updatedParagraphTruncated": false
}

Version history (8)

1.3.0

Summary

New function plugin to extract tracked changes from both DOCX and DOC files.

New Function

1. extractTrackedChanges

Extracts all tracked changes from a DOCX or DOC File

Inputs:

  • document (Document) — the DOCX or DOC file to extract tracked changes from

Outputs: Returns a JSON array with the following structure:

{
"id": 1,
"changeType": "INSERTION",
"author": "Jane Doe",
"date": "2024-03-15T09:30:00Z",
"changedText": "the inserted or deleted text",
"changedTextTruncated": false,
"charCount": 29,
"prefixAnchor": "text immediately before the change",
"suffixAnchor": "text immediately after the change",
"paragraphIndex": 0,
"runIndex": 0,
"originalParagraph": "the paragraph as it reads with the change rejected",
"updatedParagraph": "the paragraph as it reads with the change accepted",
"originalParagraphTruncated": false,
"updatedParagraphTruncated": false
}

1.2.1

Summary

Adds four new smart services to the ps-plugin-DocxTools plugin for interacting
with Microsoft Word DOCX documents.

New Smart Services

1. ExtractCommentsFromDocx

Extracts all comments from a DOCX file and returns them as a JSON comment tree.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • OnlyUnresolved (Boolean, default false) — filters out resolved comments and their subtrees

Outputs: CommentsJson (Text), CommentCount (Integer), Error (Boolean), ErrorMessage (Text)

Key features:

  • Threaded replies via word/commentsExtended.xml (Word 2013+); falls back to flat list for older files
  • Resolved status (true/false/null) per comment
  • Anchor text — the text highlighted when the comment was created
  • Output consumable via a!fromJson() in Appian
2. InspectTrackChangesFromDocx

Inspects a DOCX file to determine whether track changes recording is enabled
and whether there are pending unaccepted changes.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • IgnoreFormattingChanges (Boolean, default false) — excludes formatting-only changes when detecting pending changes

Outputs: TrackChangesEnabled (Boolean), HasPendingChanges (Boolean), Error (Boolean), ErrorMessage (Text)

3. ExtractUrlsFromDocx

Extracts all hyperlinks (URLs) from a DOCX file.

Inputs:

  • SourceDocument (Document) — the DOCX file to process

Outputs: Urls (Text Array), UrlCount (Integer), Error (Boolean), ErrorMessage (Text)

4. ExtractEmbeddedDocumentsFromDocx

Extracts files embedded as OLE objects inside a DOCX and saves them as Appian documents.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • TargetFolder (Folder) — where to save the extracted files

Outputs: ExtractedCount (Long), ExtractedDocuments (List of Document), Error (Boolean), ErrorMessage (Text)

1.2.0

Summary

Adds four new smart services to the ps-plugin-DocxTools plugin for interacting
with Microsoft Word DOCX documents.

New Smart Services

1. ExtractCommentsFromDocx

Extracts all comments from a DOCX file and returns them as a JSON comment tree.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • OnlyUnresolved (Boolean, default false) — filters out resolved comments and their subtrees

Outputs: CommentsJson (Text), CommentCount (Integer), Error (Boolean), ErrorMessage (Text)

Key features:

  • Threaded replies via word/commentsExtended.xml (Word 2013+); falls back to flat list for older files
  • Resolved status (true/false/null) per comment
  • Anchor text — the text highlighted when the comment was created
  • Output consumable via a!fromJson() in Appian
2. InspectTrackChangesFromDocx

Inspects a DOCX file to determine whether track changes recording is enabled
and whether there are pending unaccepted changes.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • IgnoreFormattingChanges (Boolean, default false) — excludes formatting-only changes when detecting pending changes

Outputs: TrackChangesEnabled (Boolean), HasPendingChanges (Boolean), Error (Boolean), ErrorMessage (Text)

3. ExtractUrlsFromDocx

Extracts all hyperlinks (URLs) from a DOCX file.

Inputs:

  • SourceDocument (Document) — the DOCX file to process

Outputs: Urls (Text Array), UrlCount (Integer), Error (Boolean), ErrorMessage (Text)

4. ExtractEmbeddedDocumentsFromDocx

Extracts files embedded as OLE objects inside a DOCX and saves them as Appian documents.

Inputs:

  • SourceDocument (Document) — the DOCX file to process
  • TargetFolder (Folder) — where to save the extracted files

Outputs: ExtractedCount (Long), ExtractedDocuments (List of Document), Error (Boolean), ErrorMessage (Text)

1.01.0

Updated API usage and license file

1.0.3

Security Upgrades

1.0.2

Security Updates

1.0.1

Security Updates

1.0.0

[MIGRATED] Plugin to interact with Microsoft Word DOCX documents.

Un-protect and Copy DOCX

  • Create an un-protected copy of a protected DOCX document