Skip to content

Instantly share code, notes, and snippets.

@magicshui
Created December 19, 2011 12:05
Show Gist options
  • Save magicshui/1496906 to your computer and use it in GitHub Desktop.
Save magicshui/1496906 to your computer and use it in GitHub Desktop.
join the ppt files into one single ppt file
# 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