Как вы перебираете таблицу, находите и заменяете текст? Я могу go через текстовые поля, как показано ниже, но мне нужна возможность доступа и редактирования информации в таблице:
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_text_frame:
j = 0
k = 0
for i in searchList:
#find the search term from the searchList
searchString = searchList[j]
j+=1
#replace the search term from the dataframe
dfIndexName = dfIndex.keys()[k]
k+=1
replaceString = df.at[0, dfIndexName]
if (shape.text.find(searchString))!=1:
text_frame = shape.text_frame
cur_text = text_frame.paragraphs[0].runs[0].text
new_text = cur_text.replace(searchString, str(replaceString))
text_frame.paragraphs[0].runs[0].text = new_text
Спасибо!