我一直在尝试使用以下方法在MS Word文档中找到突出显示的颜色 python-docx(python-docx-0.8.6,python 2.7、32位)并根据其突出显示颜色处理文本的每一部分。
根据文档,我尝试导入/使用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
Run Code Online (Sandbox Code Playgroud)
如何导入颜色索引?