Home > Posts > PPTmerge – merge multiple PowerPoint Presentations into a single .PPT file

PPTmerge – merge multiple PowerPoint Presentations into a single .PPT file

1) In a folder you wish (say onto the desktop one) create a subfolder named "PPTmerge".

2) At that same folder (say the desktop one) create a file named PPTmerge.vbs (or whatever filename you wish with a .vbs [=VBScript] file extension) and add the following content in it:

‘PPTmerge – merges several PowerPoint presentations (.PPT files) together
‘Author: George Birbilis (birbilis@kagi.com) / Zoomicon (www.zoomicon.com)
‘Version: 12Dec2007

Const PPTMERGE_FILE = "Merged.ppt"
Const PPTMERGE_FOLDER = ".\PPTmerge"

Dim Application
Set Application=CreateObject("PowerPoint.Application")
Application.Visible = True ‘must do this for merge to work

Dim first
first = True

Set fs=CreateObject("Scripting.FileSystemObject")
Dim folder
Set folder = fs.GetFolder(PPTMERGE_FOLDER)

Dim out

Dim ff
For Each ff in folder.Files
MsgBox ff.Name
f = PPTMERGE_FOLDER + "\" + ff.Name
If first Then
  Dim p
  Set out = Application.Presentations.Open(f)
  out.SaveAs PPTMERGE_FOLDER + "\..\" + PPTMERGE_FILE
  first = False
Else
  out.Slides.InsertFromFile f, out.Slides.Count
End If
Next
If Not first Then
out.Save
out.SlideShowSettings.Run
‘out.Close
End If
Set folder = Nothing

Set out = Nothing

Set folder = Nothing

‘Application.Quit
Set Application = Nothing

3) Then place the .PPT files you want to merge into the "PPTmerge" subfolder and double-click PPTmerge.vbs at the parent folder to launch PowerPoint, have the files merged and the presentation launched for review (the presentation file is named "Merged.ppt" and placed at the parent folder of the "PPTmerge" subfolder [e.g. on the desktop]). To enforce a certain merge order, name the files using an alphanumeric (sortable) prefix, for example "1 – Intro.ppt", "2 – Management.ppt", "3 – R&D.ppt" etc.

To remove the messagebox shown at each merge step comment out the command "MsgBox ff.Name" above, by prepending a ‘ [apostrophe] before MsgBox which will comment out that script line.

If you wish PowerPoint to close right after merging (instead of previewing the merged presentation), remove the ‘ (apostrophe), that is the whole-script-line comment char from the commands "out.Close" and "Application.Quit" and prepend the command "out.SlideShowSettings.Run" with that char (‘). Unfortunately you cannot avoid having PowerPoint application window display while merging, the command "Application.Visible = True" seems to be needed. However you could tell the powerpoint application to start minimized (use VBA editor [show the respective toolbar at PowerPoint to find it] and press F2 to see the Object Browser, then search for minimized – if you can’t find how to do it just drop me an e-mail)

For the above to work you need PowerPoint installed (tried with Office97, Office2000, OfficeXP and Office2007) and Windows Script Host (pre-installed by default at WinXP and Windows Vista, can get it from http://msdn2.microsoft.com/en-us/library/ms950396.aspx)

You can also find the above script file for download at my tranXform website

Note that if at Vista you may need to edit ".\PPTmerge" and use a full path instead (to get the path of a folder you visit it with Windows Explorer and click at the empty area near the right end of the address bar at the top of Windows Explorer Window so that the address bar shows a path like "c:\users\john\desktop\PPTmerge" that you can select and copy-paste where you wish)

Categories: Posts
  1. George
    2008/09/30 at 02:24 | #1

    also checkout
    http://office.microsoft.com/en-us/powerpoint/HA011587531033.aspx?ac=1&uc=1&WT.mc_id=45#CombineMult
    and
    http://office.microsoft.com/en-us/powerpoint/HP030811781033.aspx
    (the last one may be helpful if you want PPTmerge to merge multiple files with each one preserving their style, instead of all getting the style of the 1st file merged)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 931 other followers