Install
openclaw skills install word-document-creatorCreate and validate Word documents using a hybrid method with Word COM and python-docx, featuring multi-layer encoding defense and error handling.
openclaw skills install word-document-creator工业级Word文档创建器 - 使用Word COM创建空白文档 + python-docx编辑内容的混合方案,包含三层编码防御、COM异常熔断、文件反读验证。
interpreter: D:\openclaw_project\venv\Scripts\python.exe
script: scripts/word_creator.py
args: ["--title", "{title}", "--content", "{content}", "--output", "{output_path}"]
title: 文档标题(字符串)content: 内容段落列表(JSON数组字符串)output_path: 输出文件路径(完整路径)os.environ['PYTHONIOENCODING'] = 'utf-8'os.system('chcp 65001 > nul')sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')sys.exit(1))os.path.exists()os.path.getsize() > 0WORD_STYLE_CONFIG = {
'title_font_size': 18, # 小二
'normal_font_size': 12, # 小四
'line_spacing': 1.5, # 1.5倍行距
'paragraph_spacing': 12, # 段前段后12磅
'font_family': '微软雅黑', # 默认字体
'title_alignment': 1, # 居中
'normal_alignment': 0, # 左对齐
}
l0dUoXsQPIKl1WF5yRBKF6369zaF2OPn# 直接调用技能
create_robust_word_doc(
title="华为未来二十年",
content_paragraphs=[
"中国作为世界第二大经济体...",
"从经济总量来看...",
"未来二十年,随着科技创新..."
],
output_path=r"E:\Desktop\华为未来二十年.docx"
)
D:\openclaw_project\venv\Scripts\python.exeQuit()释放文件