Word Automation

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).

MIT-0 · Free to use, modify, and redistribute. No attribution required.
8 · 5.7k · 24 current installs · 27 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description, SKILL.md, and the bundled Python script all consistently implement Word/WPS automation via pywin32 COM. One minor metadata inconsistency: registry metadata lists no OS restriction while SKILL.md and the script require Windows and Word/WPS; otherwise required components (pywin32, Word/WPS) are proportional to the stated purpose.
Instruction Scope
SKILL.md instructs the agent to run the local Python script on specified document paths and to install pywin32. The instructions do not request unrelated files, environment variables, or outbound endpoints; they are scoped to single-document editing operations as advertised.
Install Mechanism
There is no install spec—this is instruction-only with an included script. SKILL.md asks the user to pip-install pywin32 (a reasonable, minimal dependency). No remote downloads or obscure installers are used.
Credentials
The skill declares no required environment variables or credentials and the code does not read environment secrets. Requested resources are limited to local files and a local Office application.
Persistence & Privilege
always is false and the skill does not modify other skills or global agent config. It runs locally when invoked and does not attempt to persist elevated privileges or global changes.
Assessment
This package appears coherent and implements what it claims: a local Python script that automates Word/WPS via COM. Before installing/running it: 1) ensure you run it on a Windows machine with Office or WPS and install pywin32 as instructed; 2) only open trusted documents—automatically opening untrusted Word files can trigger macros or external content and may be dangerous; 3) the skill will read and modify the files you point it at (it can overwrite outputs), so back up important documents; 4) there are no network calls or credential requests in the code, but if you have concerns, inspect the script locally or run it in a VM/sandbox first.

Like a lobster shell, security has layers — review code before you run it.

Current versionv0.1.0
Download zip
latestvk976z1crwfaqv9jq6pfg3fhshn804mb4

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

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

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.

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

replace

Find/replace text.

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.

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.

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.

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.

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.

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").

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.

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.

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.

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…