Macro to Print only Certain Slides

  • Thread starter Thread starter John Michl
  • Start date Start date
J

John Michl

I have a presentation of about 99 slides of which only 35 should be
printed in Notes format to create a participant booklet. Each slide
that should be in the booklet includes an icon that I have named
"PBook".

Is there a macro I could use that would do the following...

1) Identify all slides that include the shape "PBook"
2) Print only those slides in Note page format

Thanks for the help.

- John
 
John Michl said:
I have a presentation of about 99 slides of which only 35 should be
printed in Notes format to create a participant booklet. Each slide
that should be in the booklet includes an icon that I have named
"PBook".

Named in the sense that PBoook is the shape's name? If so, what you want to do
should be fairly simple.
 
Yes, Steve. I've named the shape.

However, now I'm not sure this will work as intended. I manually
entered the slide numbers to print as note pages and the page numbers
were the slides instead of actual page in the printout. (In the print
dialog said print slides 1,2,4,6. The note pages were numbered 1,2,4,6
instead of 1,2,3,4.)

So, now I think I need a macro that will delete all slides that don't
have the shap PBook on the slide. I'm not very familiar with PPT
macros (though I've done alot of Excel VBA). Any help would be
appreciated.

Thanks for the help.

- John
 
Yes, Steve. I've named the shape.

However, now I'm not sure this will work as intended. I manually
entered the slide numbers to print as note pages and the page numbers
were the slides instead of actual page in the printout. (In the print
dialog said print slides 1,2,4,6. The note pages were numbered 1,2,4,6
instead of 1,2,3,4.)

So, now I think I need a macro that will delete all slides that don't
have the shap PBook on the slide. I'm not very familiar with PPT
macros (though I've done alot of Excel VBA). Any help would be
appreciated.

Thanks for the help.

- John
 
John Michl said:
Yes, Steve. I've named the shape.

However, now I'm not sure this will work as intended. I manually
entered the slide numbers to print as note pages and the page numbers
were the slides instead of actual page in the printout. (In the print
dialog said print slides 1,2,4,6. The note pages were numbered 1,2,4,6
instead of 1,2,3,4.)

So, now I think I need a macro that will delete all slides that don't
have the shap PBook on the slide. I'm not very familiar with PPT
macros (though I've done alot of Excel VBA). Any help would be
appreciated.


I'm glad you mentioned the numbering problem early on. That'll save some
wheelspinning. Thanks!

Try this (on a COPY of your presentation, since we're going to delete slides)

Sub PruneSlides()

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long

For x = ActivePresentation.Slides.Count To 1 Step -1

Set oSl = ActivePresentation.Slides(x)

' Access the shape and deal with the error if it's not present
On Error Resume Next
Set oSh = oSl.Shapes("Fred")
If Not oSh Is Nothing Then
oSl.Delete
End If
Set oSh = Nothing

Next

End Sub
 
Thanks, Steve.

This was exactly the opposite of what I was looking for. I wanted to
delete all slides that didn't have the shape "PBook". Therefore I
changed the line "If Not oSh is Nothing Then" to "If oSH is Nothing
Then."

Worked like a charm!

- John
 
John Michl said:
Thanks, Steve.

This was exactly the opposite of what I was looking for. I wanted to
delete all slides that didn't have the shape "PBook". Therefore I
changed the line "If Not oSh is Nothing Then" to "If oSH is Nothing
Then."

Worked like a charm!

Excellent! Thanks for the feedback.
 

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

Back
Top