【发布时间】:2017-03-08 10:54:17
【问题描述】:
我一直在尝试使用python-docx(python-docx-0.8.6,python 2.7,32 位)在 MS Word 文档中查找突出显示颜色,并根据其突出显示颜色处理每段文本。
按照文档,我尝试导入/使用WD_COLOR_INDEX,但似乎找不到它。
from docx.enum import *
if (doc.paragraphs[i].runs[j].font.highlight_color == WD_COLOR_INDEX.YELLOW):
#do the appropriate thing for the yellow-highlighted text
如何导入颜色索引?
【问题讨论】:
标签: python ms-word highlight python-docx