How do I find an existing image in MS document table and replace it with a new one? With this code am able to find table cell/location of an image and add new image, but it doesn't replace the old image.
from docx import Document
from docx.shared import Inches
doc = docx.Document('myWordDoc.docx')
tables = doc.tables
# Find existing image and remove it then add new image
img = tables[0].rows[0].cells[0].add_paragraph()
r = img.add_run()
r.add_picture('/tmp/foo.jpg', width=Inches(2.5))
Is this possible with python-docx module or any other module?