使用Python从PowerPoint演示中选择幻灯片
要从PowerPoint演示文稿中打印特定的幻灯片,基于项目列表,我们使用基本PowerPoint工具Ctrl+F之后:
- 避免幻灯片ID
- 避免第二个幻灯片ID
- 使用这些ID,这需要大量工作量。
我们认为使用Python脚本自动化此任务。
from pptx import Presentation
filename = "C:/Users/RElKassah/Desktop/test.pptx"
prs = Presentation(filename)
text="test"
for slide in prs.slides:
if slide.shapes ==text:
title = slide.shapes.text.find = 'test'
print(title)
To print specific slides from a PowerPoint presentation, based on a list of items we use the basic PowerPoint tool Ctrl+F following this process:
-save the slide ID
-save the second slide ID
-print with those IDs and that takes a lot of workloads.
We think to automate this task with a Python script.
from pptx import Presentation
filename = "C:/Users/RElKassah/Desktop/test.pptx"
prs = Presentation(filename)
text="test"
for slide in prs.slides:
if slide.shapes ==text:
title = slide.shapes.text.find = 'test'
print(title)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里,我写了一些简单的循环以在PPTX文件中找到文本,然后打印包含该文本的幻灯片的幻灯片。希望它能有所帮助。
Here I wrote some simple loop to find text inside a pptx file, then print slide number of slides that contain that text. Hope it could help.