def opendocx(file):
    """Open a docx file, return a document XML tree"""
mydoc = zipfile.ZipFile(file)
xmlcontent = mydoc.read('word/document.xml')
document = etree.fromstring(xmlcontent)
return document
Text-Replace in docx and save the changed file with python-docx