How Python implements inserting new slide pages into a PPT file

Source: Internet
Author: User
Tags blank page

This article mainly introduced the Python implementation to the PPT file inserts the new slide page The method, involves the Python operation PPT document to add the slide the related skill, very has the practical value, needs the friend to be possible to refer to under

This example describes how Python implements a new slide page in a ppt file. Share to everyone for your reference. The implementation methods are as follows:


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17-18 #-*-coding:utf-8-*-import win32com.client import win32com.client.dynamic import os #我的示例 (Template) document name is BUGCURVE.PPTX Def PowerPoint (): ppt = Os.path.join (OS.GETCWD (), "bugcurve.pptx") App = Win32com.client.Dispatch (" PowerPoint.Application ") app.visible = True presentation = App.Presentations.Open (ppt) myslide = PRESENTATION.SLIDES.ADD (2) #这份 presentation to add a Slide, the position is inserted on the second page, after #也就是封面 (the first page), 12 The magic number is ... #告诉PPT that page is a blank page img = os.path.join (OS.GETCWD (), "this_is_picture.png") shape = MySlide.Shapes.AddPicture (IMG, linktofile=false,savewithdocument=true,left=40,top=100,width=650,height=400) #mySlide to add a box (shape) Specify the size and position of the box, #然后那个 shape to fit into the shape

I hope this article will help you with your Python programming.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.