Использую следующий код:
PythonВыделить код
from docx import Document word_to_find = "chuka" def highlight_word_in_tables(doc, word_to_find): for table in doc.tables: for row in table.rows: for cell in row.cells: for paragraph in cell.paragraphs: if word_to_find in paragraph.text: for run in paragraph.runs: if word_to_find in run.text: run.font.highlight_color = 7