This code can’t seem to access text inside shapes, is there a way how to?
from docx import Document
doc = Document('template.docx')
replace_word = {'Captain': 'Gerard B. Geronimo'}
for word in replace_word:
for p in doc.paragraphs:
if p.text.find(word) >= 0:
p.text = p.text.replace(word, replace_word[word])
doc.save('note_demo.docx')
I tried everything that I could find on the internet but couldn’t find anything.