wps-word-automation Pass

Automate common Word/WPS document operations on Windows via COM (read text, replace, insert, headings, headers/footers, page breaks, merge, split, export to PDF/TXT, add/replace images). Use for single-document actions (no batch).

58out of 100
1.0k
stars
285
downloads
443
views

// Install Skill

Install Skill

Skills are third-party code from public GitHub repositories. SkillHub scans for known malicious patterns but cannot guarantee safety. Review the source code before installing.

Install globally (user-level):

npx skillhub install openclaw/skills/wps-word-automation

Install in current project:

npx skillhub install openclaw/skills/wps-word-automation --project

skill.install.customTargetHelp

npx skillhub install openclaw/skills/wps-word-automation --target-dir /path/to/skills

Suggested path: ~/.claude/skills/wps-word-automation/

AI Review

58
out of 100
Instruction Quality60
Description Precision55
Usefulness55
Technical Soundness65

Scored 58 — practical document automation with Python COM script. Good command variety and clear scope limiting. Score reflects Windows-only lock and COM-based approach.

betamoderatewindows-devsoffice-automationdocument-automationword-processingpdf-export
Reviewed by claude-code on 3/20/2026

SKILL.md Content

---
name: wps-word-automation
description: Automate common Word/WPS document operations on Windows via COM (read text, replace, insert, headings, headers/footers, page breaks, merge, split, export to PDF/TXT, add/replace images). Use for single-document actions (no batch).
---

# WPS/Word Automation (Windows)

Use the bundled Python script to control Word or WPS via COM.

## Requirements

- Windows with **Microsoft Word** or **WPS Writer** installed.
- Python + **pywin32** (`python -m pip install pywin32`).

## Quick start

```bash
python {baseDir}/scripts/wps_word_automation.py read --input "C:\path\file.docx"
python {baseDir}/scripts/wps_word_automation.py replace --input "C:\path\file.docx" --find "旧" --replace "新" --save "C:\path\out.docx"
python {baseDir}/scripts/wps_word_automation.py export --input "C:\path\file.docx" --format pdf --output "C:\path\out.pdf"
```

## Commands

### read
Extract plain text.

```bash
python {baseDir}/scripts/wps_word_automation.py read --input "C:\path\file.docx" --output "C:\path\out.txt"
```

### replace
Find/replace text.

```bash
python {baseDir}/scripts/wps_word_automation.py replace --input "C:\path\file.docx" --find "old" --replace "new" --save "C:\path\out.docx"
```

### insert
Insert text at start/end.

```bash
python {baseDir}/scripts/wps_word_automation.py insert --input "C:\path\file.docx" --text "Hello" --where start --save "C:\path\out.docx"
```

### headings
Apply Heading 1/2/3 to matching lines.

```bash
python {baseDir}/scripts/wps_word_automation.py headings --input "C:\path\file.docx" --level 1 --prefix "# " --save "C:\path\out.docx"
```

### header-footer
Set header/footer text.

```bash
python {baseDir}/scripts/wps_word_automation.py header-footer --input "C:\path\file.docx" --header "标题" --footer "页脚" --save "C:\path\out.docx"
```

### page-break
Insert a page break at the end.

```bash
python {baseDir}/scripts/wps_word_automation.py page-break --input "C:\path\file.docx" --save "C:\path\out.docx"
```

### merge
Merge multiple docs into one.

```bash
python {baseDir}/scripts/wps_word_automation.py merge --inputs "a.docx" "b.docx" --output "merged.docx"
```

### split
Split by page ranges (e.g., "1-3,4-6").

```bash
python {baseDir}/scripts/wps_word_automation.py split --input "C:\path\file.docx" --pages "1-3,4-6" --outdir "C:\out"
```

### export
Export to PDF or TXT.

```bash
python {baseDir}/scripts/wps_word_automation.py export --input "C:\path\file.docx" --format pdf --output "C:\path\out.pdf"
python {baseDir}/scripts/wps_word_automation.py export --input "C:\path\file.docx" --format txt --output "C:\path\out.txt"
```

### image
Add or replace image at the end.

```bash
python {baseDir}/scripts/wps_word_automation.py image --input "C:\path\file.docx" --image "C:\path\img.png" --save "C:\path\out.docx"
```

## Notes

- If WPS is installed, try `--app wps`; otherwise default uses Word.
- Use `--visible true` if you need to watch the UI.
- Avoid batch usage; this skill is for single-document operations.

License

Declared license: MIT

MIT License

Copyright (c) 2026 openclaw

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View the license in the source repositorythe version published there is authoritative.