You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to separate contents of a document based on the highlight color of font. e.g.
Third party is coloring the documents for me. In some cases, pydocx is not recognizing any highlight color for the text in the document, but when I again highlight the same font with same color, it recognizes the highlight color. What wrong could be going when the third party is coloring it?
The text was updated successfully, but these errors were encountered:
Has it been resolved? My code is reporting an error: ValueError: WD_COLOR_INDEX has no XML mapping for 'none'. The code is following: from docx import Document
from docx.enum.text import WD_COLOR_INDEX
doc = Document('D:/Desktop/123.docx')
para = doc.paragraphs[0]
for index, run in enumerate(para.runs):
if run.font.highlight_color is None:
print(1)
else:
print(2)
Hello,
I am trying to separate contents of a document based on the highlight color of font. e.g.
Third party is coloring the documents for me. In some cases, pydocx is not recognizing any highlight color for the text in the document, but when I again highlight the same font with same color, it recognizes the highlight color. What wrong could be going when the third party is coloring it?
The text was updated successfully, but these errors were encountered: