pptx-修改-text_box

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')

转载于:https://www.cnblogs.com/xiesongyou/p/8108611.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值