Created
December 19, 2011 12:05
-
-
Save magicshui/1496906 to your computer and use it in GitHub Desktop.
join the ppt files into one single ppt file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put all the files into a folder,and change the path var below | |
import win32com.client , sys , os , glob | |
Application = win32com.client.Dispatch("PowerPoint.Application") | |
Application.Visible = True | |
new_ppt = Application.Presentations.Add() | |
path = "C:\\" | |
os.chdir(path) | |
for files in glob.glob(os.path.join(path,"*.ppt")): | |
exit_ppt = Application.Presentations.Open(files) | |
page_num = exit.Slides.Count | |
exit_ppt.Close() | |
num = new_ppt.InsertFromFile(files,new_ppt.Slides.Count,1,page_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment