prs = Presentation(‘2017年北科建第一阶段满意度调研报告V.7.0汇报.pptx‘)
slide=prs.slides[2]
j=1
for shape in slide.shapes:
if not shape.has_text_frame:
continue
text_frame = shape.text_frame
print(str(j)+‘=>‘+text_frame.text)
j+=1
if j==8:
text_frame = shape.text_frame
text_frame.clear() # not necessary for newly-created shape
p = text_frame.paragraphs[0]
run = p.add_run()
run.text = ‘我的数据‘
font = run.font
font.name = ‘Calibri‘
font.size = Pt(36)
font.bold = True
font.italic = None # cause value to be inherited from theme
font.color.rgb = RGBColor(0, 0, 0)
p1 = text_frame.add_paragraph()
text_frame.word_wrap=True
run1 = p.add_run()
run1.text = ‘\n保持北科建服务优势\n找出北科建关键短板\n提升北科建竞争优势‘
font = run1.font
font.name = ‘Calibri‘
font.size = Pt(24)
font.bold = True
font.italic = None # cause value to be inherited from theme
font.color.rgb = RGBColor(0, 0, 0)
prs.save(‘test.pptx‘)
pptx-txt
Posted 沧海一粒水
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pptx-txt相关的知识,希望对你有一定的参考价值。
以上是关于pptx-txt的主要内容,如果未能解决你的问题,请参考以下文章