这是一个创建于 2519 天前的主题,其中的信息可能已经有所发展或是发生改变。
def ppoint():
app = 'PowerPoint'
ppoint = win32.gencache.EnsureDispatch('{}.Application'.format(app))
pres = ppoint.Presentations.Add()
ppoint.Visible = True
sl = pres.Slides.Add(1,win32.constants.ppLayoutText)
sleep(1)
sla = sl.Shapes[0].TextFrame.TextRange
sla.Text = 'Python-to-{} Demo'.format(app)
sleep(1)
slb = sl.Shapes[1].TextFrame.TextRange
for i in RANGE:
slb.InsertAfter('Line {}\r\n'.format(i))
sleep(1)
slb.InsertAfter("\r\bTh-th-th-that's all folks!")
warn(app)
pres.Close()
ppoint.Quit()
错误信息 builtins.TypeError: 'Shapes' object does not support indexing