Programmatically add a SlideNumber placeholder in PowerPoint 2010 using vba?
Posted on 2012-03-12
I'm writing a vba macro to clean up and standardize slide numbering in a PowerPoint (2010) deck assembled from other old decks. Each slide might bring with it a different slide number placeholder, and they don't automatically conform. My plan is to go to the master, delete any existing slidenumber placeholder, re-add it and format it like I want it. Then go to each layout and delete and re-display the placeholder, then finally go to each slide and do the same.
I know how to access and can successfully manipulate the slide number placeholder if it already exists on any master, layout, or slide, but can't figure out how to ADD the slide number placeholder if it does not already exist. The HeadersFooters.SlideNumber object has only a handful of properties (such as .visible true or false) that aren't very useful for what I'm trying to do. I tried just adding a shape to the master named "Slide Number Placeholder 1" but PowerPoint does not recognize that as the HeadersFooters.SlideNumber object.
Essentially, I want vba to duplicate this series of steps (where's that dang macro recorder when you need it?!):
-(Go to master)
-(Check Slide Number Placeholder box)
Or, for a layout it would be:
(go to desired layout)
(in the Master Layout group), check "Footers"
Or, for a slide it would be:
Check Slide Number
Appreciate any pointers!