Task Pane Add-in for Microsoft Word with a ChatGPT interface for document work.
- Document Chat — ask questions about document content
- Rephrase — rewrite selected text while preserving meaning
- Compress — reduce text to 30-50% of original
- Expand — add clarifications and details to text
- Summarize — create structured document summary
- Generate Sections — create new sections from description
- Node.js 18+
- Microsoft Word for Mac (Microsoft 365) or Word Online
- OpenAI API key
# Clone the repository
cd WordAI
# Install dependencies
npm install
# Create .env file in server folder
cp server/env.example server/.env
# Edit .env and add your OpenAI API keyOPENAI_API_KEY=sk-your-api-key-here
OPENAI_API_BASE=https://api.openai.com/v1
LLM_MODEL=gpt-4o-mini
PORT=3001
MAX_CONTEXT_CHARS=8000# Start client and server simultaneously
npm run dev
# Or separately:
npm run dev:client # Frontend at https://localhost:3000
npm run dev:server # Backend at http://localhost:3001On first client launch, vite-plugin-mkcert will automatically create and install an SSL certificate for localhost.
- Close Word
- Copy the manifest:
mkdir -p ~/Library/Containers/com.microsoft.Word/Data/Documents/wef cp manifest/word-addin-manifest.xml ~/Library/Containers/com.microsoft.Word/Data/Documents/wef/
- Open Word
- Go to: Insert → Add-ins → My Add-ins
- Find "AI Assistant" and activate it
- Open Word
- Go to: Insert → Add-ins → My Add-ins
- Select the Shared Folder tab
- Click Browse and select
manifest/word-addin-manifest.xml
- Open Word Online (office.com)
- Create or open a document
- Insert → Add-ins → Manage My Add-ins
- Upload My Add-in → select
word-addin-manifest.xml
- Open a document in Word
- Click the AI Assistant button on the Insert ribbon
- Select the mode from the dropdown
- Enter your request and click Send
| Mode | Requires Selection | Description |
|---|---|---|
| Document Chat | No | Ask questions about document content |
| Rephrase | Yes | Rewrite selected text |
| Compress | Yes | Reduce text by 50-70% |
| Expand | Yes | Add details and clarifications |
| Summarize | No | Create structured summary |
| Generate Section | No | Create new section from description |
- Use selected text — take context from selection (otherwise from entire document)
- Replace selected text — automatically replace selection with result
Click ⚙️ in the panel to access settings:
- LLM Model — OpenAI model (gpt-4o-mini, gpt-4o, etc.)
- Max context characters — text limit for sending to LLM
- Legal style — use legal terminology in prompts
WordAI/
├── manifest/
│ └── word-addin-manifest.xml # Office Add-in manifest
├── client/ # React + Vite + TypeScript
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # React hooks
│ │ ├── office/ # Office.js wrappers
│ │ ├── api/ # HTTP client
│ │ └── utils/ # Prompts and utilities
│ └── vite.config.ts
├── server/ # Express + TypeScript
│ ├── src/
│ │ ├── index.ts # HTTP server
│ │ └── llm.ts # OpenAI integration
│ └── .env # Configuration (not in git)
├── config/
│ └── config.example.json # Example configuration
└── package.json
On first launch, the browser may show a certificate warning. Add an exception or:
# macOS - trust certificate
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.vite-plugin-mkcert/cert.pem- Make sure dev server is running (
npm run dev) - Open https://localhost:3000 in browser and accept the certificate
- Restart Word
- Check Word console for errors (Cmd+Option+I in Word Online)
- Check
OPENAI_API_KEYinserver/.env - Check server logs in terminal
- Make sure the model is available for your API key
