[Lowerbounds, Upperbounds]

Algorithms are everywhere.

Some days ago Anupam asked me how to insert a blank slide right after the current one during a slide show. It may seem curious to many people, but if you teach with a Tablet PC, then it makes perfect sense. This is analogous to having blank transparencies (and the Tablet stylus as the marker) when using an overhead projector. It’s especially useful when a question pops up from the audience and you would like to address it with the help of writing things down. And if you are using PowerPoint 2003, you can retain all the handwritings you made during the slide show and distribute them together with the exisiting slides.

The straightforward way of doing it is to break out from the slide show, insert a blank slide and then resume the show. But do we have a slicker way?

Turns out this is not hard to do in PowerPoint. First, press Alt-F11 (Tools->Macro->Visual Basic Editor). Select Insert->Module in the main menu. Now enter the following code:

Sub InsertBlankSlide()
Dim newIndex As Long
With ActivePresentation
newIndex = .SlideShowWindow.View.Slide.SlideIndex + 1
.Slides.Add newIndex, ppLayoutBlank
.SlideShowWindow.View.GotoSlide newIndex
End With
End Sub

Select File->Close and Return to PowerPoint. Now go to the Master slide and create a new shape there. Right click on that shape and select Action Settings. In the Mouse Click tab, select Run Macro and pick InsertBlankSlide from the combo box underneath it. Click OK and there you go. (Try running the presentation and click on that new shape.)

For a more elaborate example that also includes changing pen type, I refer you to Anupam’s slides in 15-251 (CMU’s 200-level CS theory core). For example, look at this one. It’s true that you can change the pen type by pressing hot keys during a slide show, but if you are using a slate Tablet PC, then you don’t have a keyboard.

P.S. It would be nice if we can change the pen weight programmatically since the default pen weight is a bit too thick. However, I haven’t spent enough time to get it working. All I know is that this is not possible in the object model that PowerPoint exposes. That, however, only means this cannot be done easily (as I have an example here). On the other hand, Anupam has pointed out that you only need to change the pen weight once during a slide show and the weight will not change during the rest of the show. I guess it’s easier to wait for Office 12 to come out than to nail it. :P

3 Comments

  1. Doug Robinson
    11:54 on January 28th, 2008

    Thank you for the helpful tip. Is there any way to change the default settings to include the above shortcut so that every new presentation will have this macro embedded within it?

    Thanks.

  2. Doug Robinson
    12:38 on January 28th, 2008

    I tried the suggestion for the VB script and got it to work in a file I had already created, but I tried creating a template where the Master View was edited with this script but it didn’t work when the template was used in a new document. Any ideas on what might prevent it from working when embedded in a template?
    Thanks.

  3. AFAIK, macros do not get inherited from .pot (design template files). However, you can save an empty .ppt file and then choose File->New->From existing presentation… This is as close as it gets.