Skip to main content

Overview

Word Processing tools provide advanced capabilities for working with Microsoft Word documents (.docx). These tools enable content extraction, text highlighting, review comments, AI-powered document generation from templates, and document formatting with support for multiple languages including Japanese, Chinese, and other international character sets.

Key Features

WORD_EXTRACT

  • Extract text, tables, images, and comments (with replies) from .docx files in document order
  • Returns a structured array of elements preserving the original document structure
  • Table content is returned as a two-dimensional array of cell strings
  • Supports Japanese and other languages

WORD_TEXT_HIGHLIGHT

  • Apply colored highlights to specific text in .docx files
  • Support for multiple highlight colors
  • International character encoding support
  • Precise text matching and highlighting
  • Preserve document formatting and structure

WORD_TEXT_COMMENT

  • Add review comments to specific text in .docx files
  • Comments all occurrences of the target text by default, or only the Nth occurrence with the index option
  • Custom author name for comments (default: Jinbaflow)
  • Handles Japanese, Chinese, and other multilingual text natively

WORD_TEMPLATE_GENERATE

  • Generate a Word document based on a .dotx/.docx template
  • An LLM analyzes the template’s styles and structure, then creates content following the template’s design rules according to your instructions
  • Optionally incorporate structured data (e.g., table data, lists) into the generated document

Authentication

No authentication is required for most Word processing tools. WORD_TEMPLATE_GENERATE uses an LLM and accepts an optional OpenAI API key via the api_key config; if omitted, it defaults to Jinba credits ({{ secrets.JINBA_CREDIT_KEY }}).

Example: Extracting Document Content

WORD_EXTRACT takes a file_url pointing to a .docx file and returns a structured array of elements. Each element is one of:
  • { "type": "text", "content": "..." }
  • { "type": "table", "content": [["cell", ...], ...] }
  • { "type": "image", "name": "..." }
  • { "type": "comment", "content": "...", "author": "...", "date": "...", "target": N, "replies": [...] }

Example: Adding Review Comments

WORD_TEXT_COMMENT takes a file_url, an items map of target text to comment, and an optional author name. Each item value is { "comment": "...", "index": N } where the optional 1-based index targets the Nth occurrence; omit it to comment all occurrences. The output result is the URL of the commented .docx file.

Example: Generating a Document from a Template

WORD_TEMPLATE_GENERATE takes a template_url (.dotx or .docx), instructions describing what content to create, and optional structured data (e.g., table data, lists) to incorporate. The output is result.url, the URL of the generated document.

Example: Document Review and Highlighting

WORD_TEXT_HIGHLIGHT takes a file_url and a highlights array where each item is { "text": "...", "color": "..." }. Text matching is case-insensitive substring matching across paragraphs and table cells. The output result is the signed URL of the highlighted .docx file, which downstream steps can reference as {{steps.highlight_key_terms.result}}.

Example: Contract Review Workflow

Example: Multi-language Document Processing

Example: Educational Content Highlighting

Highlight Color Options

The color value must be one of the following python-docx highlight colors (uppercase). If omitted, it defaults to YELLOW.

Use Cases

  • Document Review: Legal contracts, technical specifications
  • Educational Materials: Textbooks, study guides, training materials
  • Content Categorization: Organize information by importance
  • Quality Assurance: Highlight issues, corrections, improvements
  • Collaboration: Mark sections for team review
  • Compliance: Highlight regulatory requirements
  • Translation: Mark text for translation or localization
  • Research: Categorize findings and key insights

Best Practices

Highlight Strategy

  • Use consistent color coding across documents
  • Create highlight legends for team collaboration
  • Limit colors to avoid visual confusion
  • Test highlighting on sample text first

International Support

  • Verify encoding compatibility for non-Latin characters
  • Test with multilingual content before bulk processing
  • Consider right-to-left text direction for Arabic/Hebrew
  • Use Unicode-compatible text matching

Performance Optimization

  • Process large documents in sections
  • Use specific text matching to reduce processing time
  • Batch similar highlighting operations
  • Monitor file size after highlighting