【发布时间】:2016-03-08 04:50:11
【问题描述】:
我有一个包含 20 张幻灯片的现有 PowerPoint 演示文稿。此演示文稿用作模板,每张幻灯片都有不同的背景。我想使用这个(现有的)PowerPoint 演示文稿,在第 4 张幻灯片中插入一张图片(对前 3 张不做任何操作)并将其另存为新的 PowerPoint 演示文稿。
这是我到目前为止所拥有的。此代码加载现有演示文稿并将其另存为新演示文稿。现在我只需要知道如何使用它来将图像插入到第 4 张幻灯片中,如上所述。
注意:我使用的是普通 Python。
from pptx import Presentation
def open_PowerPoint_Presentation(oldFileName, newFileName):
prs = Presentation(oldFileName)
#Here I guess I need to type something to complete the task.
prs.save(newFileName)
open_PowerPoint_Presentation('Template.pptx', 'NewTemplate.pptx')
【问题讨论】:
-
Powerpoint 是来自 open office 还是 microsoft?
-
有幻灯片编号。 4 已经是图片了?
-
它来自微软(如果您将鼠标悬停在帖子下方的“powerpoint”标签上,您将在说明中看到微软。)
-
然后幻灯片。 4 中没有图像。
标签: python powerpoint python-pptx