发布时间:2019-08-27 08:05:12编辑:auto阅读(2659)
import win32com from win32com.client import Dispatch, constants ppt = win32com.client.Dispatch('PowerPoint.Application') ppt.Visible = 1 pptSel = ppt.Presentations.Open("C:\\web\\phpStudy\\WWW\\ppt\\Russia\\1.pptx") # win32com.client.gencache.EnsureDispatch('PowerPoint.Application') #get the ppt's pages slide_count = pptSel.Slides.Count for i in range(1,slide_count + 1): shape_count = pptSel.Slides(i).Shapes.Count print shape_count for j in range(1,shape_count + 1): if pptSel.Slides(i).Shapes(j).HasTextFrame: s = pptSel.Slides(i).Shapes(j).TextFrame.TextRange.Text print (s.encode('utf-8')+ "\n") ppt.Quit()
上一篇: python string 中查找中文字
下一篇: 用Python监听鼠标和键盘事件
50955
50337
40954
37819
32285
29175
28062
22893
22855
21187
1040°
1723°
1406°
1340°
1601°
1435°
2090°
3632°
3549°
2506°