I want to remove some tables from a document based on the contents of the upper left cell.
I tried:
allTables = document.tables
for activeTable in allTables:
if activeTable.cell(0,0).paragraphs[0].text == 'some text':
allTables.remove(activeTable)
I expected to have removed all tables containing 'some text' in cell(0,0), but they are still in the document.
The process enters the line with "allTables.remove(activeTable)" as expected: indexToDelete = allTables.index(activeTable)
within the if statement gives the tables, I'm looking for.
The message is "Process finished with exit code 0"