An open API service indexing awesome lists of open source software.

https://github.com/henryxzx/replace_text

python 批量替换 docx 文档中的内容
https://github.com/henryxzx/replace_text

python-docx python-xlrd python3 pywin32

Last synced: about 1 year ago
JSON representation

python 批量替换 docx 文档中的内容

Awesome Lists containing this project

README

          

# 批量替换 docx 文档内容工具
批量替换 docx 文档中的内容

> 20.2.13 更新 pywin32 实现替换功能,处理结果与手动打开 word 文档操作相同。

### 项目演示

1. 将需要替换的文档跟 `main.py` 放到同一目录下

![](https://raw.githubusercontent.com/henryxzx/Image-Post/master/img/20200205183215.png?token=AIRCYLA23DFKIWXRILODAPC6HKM62)

2. 创建一个 excel 文件,命名为 `替换内容.xlsx` ,储存需要修改的值

![](https://raw.githubusercontent.com/henryxzx/Image-Post/master/img/20200205200010.png?token=AIRCYLAQLMKLI2YTOEL5XEK6HKXIS)

3. 执行 `main.py`

![](https://raw.githubusercontent.com/henryxzx/Image-Post/master/img/20200205200149.png?token=AIRCYLBTFGIXNGUBDM4DA6C6HKXOY)