VBScript batch merge PPT

Source: Internet
Author: User
Option explicitpublic filenames as variantpublic savename as variantpublic pptapp as objectsub getfiles () filenames = application. getopenfilename _ (filefilter: = "Presentation (*. PPT ),*. ppt ", filterindex: = 1, _ multiselect: = true, Title: =" open the file to be merged ") end subsub savefileas () savename = application. getsaveasfilename (initialfilename: = "document merging result", _ filefilter: = "Presentation (*. PPT ),*. ppt ", filterindex: = 1, _ title: =" Save the results of the combination of Documents ") End subsub Merge () dim pre as object dim I as double dim N as double err. clear on error resume next set pptapp = Createobject ("PowerPoint. application ") pptapp. displayalerts = false on error goto 0 if err. number <> 0 then beep msgbox "error, the system does not install MS PowerPoint", vbokonly, "merge presentation" pptapp. quit application. quit end if err. clear on error resume next set pre = pptapp. presentations. add for I = lbound (File Names) to ubound (filenames) doevents n = pre. slides. count pre. slides. insertfromfile index: = N, filename: = filenames (I) userform1.label. caption = "merging presentations... "& I &" completed! "Next on error goto 0 if err. Number <> 0 then beep msgbox" Unknown error! Exit? ", Vbokonly," merged presentation "pptapp. Quit application. Quit end if pre. saveas (savename) pptapp. displayalerts = true pptapp. Quit userform1.label. Caption =" the presentation has been merged! "Userform1.cmdquit. Caption =" OK (q) "End sub

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.