I need move a slide from one ppt to another ppt
I've a project and one of the requirements is to move a slide from one presentation to another, but i can't to find a solution and i think to doesn't exists one, i need to do this with this code
prs = Presentation('ppt2.pptx')
for slide in prs.slides:
for shape in slide.shapes:
if hasattr(shape, "text"):
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
if "Nuestra experiencia en su industria" in run.text:
url = "ppt2.pptx"
prsIndustria = Presentation(url)
slideAn = prsIndustria.slides[0]
slide = slideAn
I know that doesn't works like this but its a example. So help me with this please.
Not possible with this library.
I've solved this problem by iterating over the shapes in the source slide, copying them one by one and creating them in the dest slide. It's not an easy approach as you have to do a lot of manual work like copying over styles and contents and things like that, but for my use case it has worked just fine
Do you have a working code snippet by any chance @mszbot please?
There is no free library that provides this functionality, it's not simple. You can try aspose.com, powerpointgeneratorapi.com.