码迷,mamicode.com
首页 > 其他好文 > 详细

pptx-txt

时间:2017-12-25 13:31:28      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:des   use   阶段   run   pes   pos   from   div   sha   

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

标签:des   use   阶段   run   pes   pos   from   div   sha   

原文地址:http://www.cnblogs.com/xiesongyou/p/8108611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!