Macro: need code to FIND ALL slides, copy, and paste into another file

W

wessman

I recorded a macro in PowerPoint that:

1) opens a new blank document and cuts/deletes the first blank slide
2) saves the file as "NEW"
3) opens an existing file and goes to "Slide Sorter" view
4) does a Find All (with Match Case and Whole Word) for the word
"Outfitting"
5) copies the two slides that are now selected and pastes them into
the NEW file

....and I loop through five existing files doing this, pasting all 10
charts into the same NEW file. However, when looking at the vba I
recorded, the FIND ALL and the names of the slides I copied were not
recorded!

Application.CommandBars("Task Pane").Visible = False
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
Application.CommandBars("Task Pane").Visible = False
ActiveWindow.Selection.Cut
ActivePresentation.SaveAs FileName:="C:\NEW.ppt"
Presentations.Open FileName:="C:\ExistingFile01.ppt",
ReadOnly:=msoFalse
ActiveWindow.ViewType = ppViewSlideSorter
ActiveWindow.Selection.Copy
Windows.Item(Index:=2).Activate
ActiveWindow.View.Paste
Windows.Item(Index:=2).Activate
ActiveWindow.Close

....And how am I supposed distinguish one open file from another with
Windows.Item(Index:=2).Activate ???

Can somebody please help with write this code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top