View Single Post
 
Old 06-19-2017, 07:34 AM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Macro needed to copy Powerpoint presentation and sections

I’m trying to develop a macro that copies a Powerpoint file to a new one so a user can choose sections to delete in the copy.

My idea was to copy the active presentation to an new presentation (without saving it until needed) and display the new file’s sections in dropdowns so one can choose which ones are to be deleted and click a button to remove them (from the copy). I have a very similar application for Word, but has a simple code that creates a new Word document and copies the entire contents of the active document to the new document:

Word.Application.Documents.Add Word.ActiveDocument.FullName

There doesn’t seem to be an equivalent for Powerpoint (PowerPoint.Application.Presentations.Add msoTrue) creates a new presentation but doesn’t copy any slides from the active presentation.

So I now have code that copies all Powerpoint slides to a new Powerpoint presentation but which does NOT include the sections. I think it’s possible to copy the sections along with the slides and their formatting, but I don’t know how to do that. As a workaround, I am working on code that performs a save as but would rather just make a copy that is not saved but which includes the sections from the source file.

Can someone help with code that copies a complete Powerpoint presentation to a new (unsaved) file and includes all sections in the copy?

Code and sample file with sections is attached (in the TEMP file).
Attached Files
File Type: pptm PowerPoint Section Test.pptm (266.6 KB, 7 views)
Reply With Quote