Word Write Content

Word Write Content

Overwrite the entire contents of a Word document with formatted HTML

Node Type

Action

Category

Microsoft Word

Icon

FileText

Overview

The Word Write Content node is an action node that overwrites the entire contents of a Microsoft Word document with formatted HTML content. This powerful integration enables you to programmatically update Word documents with rich formatting, perfect for automated document generation, content updates, and workflow-based document management.

Key Features

  • HTML to Word Conversion: Converts HTML content to properly formatted Word documents
  • Rich Formatting Support: Supports headings, lists, bold/italic text, tables, and more
  • Document Selection: Choose from your OneDrive documents with an integrated picker
  • Complete Overwrite: Replaces all existing content with new HTML content
  • Microsoft Integration: Seamless integration with Microsoft OneDrive and Word Online
  • OAuth Security: Secure authentication through Microsoft OAuth
⚠️
Warning: This node will completely replace all existing content in the target document. The original content will be lost. Consider using Word Duplicate first to create a backup.

Prerequisites

Microsoft Account Connection

Must have a connected Microsoft account with appropriate permissions

Microsoft account connected via OAuth
Files.ReadWrite.All scope permissions
Access to Microsoft OneDrive

Document Requirements

Understanding of document access and HTML content requirements

The target document must be accessible through your Microsoft OneDrive
Well-formed HTML content for proper Word conversion
Clear understanding of what content should replace the existing document

Technical Requirements

Technical setup and configuration requirements

Microsoft OAuth service properly configured
Internet connectivity for Microsoft Graph API communication
Proper exception handling for API failures and authentication issues

Node Configuration

Required Fields

Document ID

Type:text
Required:Yes
Value Type:string

The ID of the Word document to write to. You can select documents from your OneDrive using the integrated file picker.

HTML Content

Type:text
Required:Yes
Value Type:HTML string

The HTML content to write to the document. Supports standard HTML tags including headings (h1-h6), paragraphs (p), lists (ul, ol), tables, bold (b, strong), italic (i, em), and more.

Examples & Use Cases

AI-Generated Report

Create reports from AI-generated content

Workflow Structure

🤖 LLM Generate → 📄 Word Duplicate → 📝 Word Write Content → 📧 Share
{
  "documentId": "{{duplicatedDocId}}",
  "htmlContent": "{{aiGeneratedHTML}}"
}

Use LLM to generate HTML content, duplicate a template, then write the AI content to the new document.

Dynamic Document Population

Populate Word documents with workflow data

{
  "documentId": "{{contractDocId}}",
  "htmlContent": "<h1>Contract Agreement</h1><p>Between: {{party1}} and {{party2}}</p><p>Date: {{currentDate}}</p><p>{{contractTerms}}</p>"
}

Dynamically populate a contract document with data from your workflow using template variables.

Formatted Email to Document

Convert email content to Word documents

Workflow Structure

📧 Gmail Read → 🔄 Process HTML → 📄 Word Write → 💾 Archive

Read email HTML content, format it, and write to a Word document for archival purposes.

Best Practices

Do's

  • Use well-formed HTML for best conversion results
  • Test HTML formatting before large-scale deployment
  • Create backups before overwriting important documents
  • Use Word Duplicate to preserve originals
  • Include proper HTML structure (headings, paragraphs)
  • Check Success field before assuming completion

Don'ts

  • Don't use complex CSS that won't convert to Word
  • Avoid overwriting documents without backups
  • Don't forget to handle write failures
  • Avoid very large HTML content that may timeout
  • Don't use unsupported HTML tags
  • Avoid hardcoding document IDs when possible
💡
Pro Tip: Word supports standard HTML formatting but not all CSS. Stick to basic HTML tags: h1-h6 for headings, p for paragraphs, ul/ol for lists, table for tables, b/strong for bold, i/em for italic. For best results, generate HTML specifically formatted for Word conversion.

Troubleshooting

Common Issues

Formatting Not Preserved

Symptoms: HTML doesn't convert to Word formatting correctly

Solution: Use simple, standard HTML tags. Avoid complex CSS, inline styles, or JavaScript. Test with basic HTML first, then add complexity gradually.

Document Not Found

Symptoms: Node fails with document not found error

Solution: Verify the document ID is correct and the document exists in OneDrive. Check that the user has access and write permissions.

Content Truncated

Symptoms: Only part of the HTML content appears in the document

Solution: Very large HTML content may exceed limits. Break content into smaller chunks or simplify the HTML structure.

Permission Errors

Symptoms: Node fails with insufficient permissions

Solution: Ensure the Microsoft account connection has Files.ReadWrite.All scope. Reconnect the Microsoft account if needed.

Related Resources