Identify existing placeholders on notes master

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a macro that checks the notes master for existing
placeholders and adds only those placeholders (of the six available) that do
not already exist.

I am able to delete all placeholders and then create all placeholders, but
then the slides do not automatically reflect the formatting of the newly
added placeholders. Yes, I could reapply the master to all slides but that
messes with the formatting inside the body text box (my tabs and indentation
settings get lost).

I know how to check the type of a placeholder and then do something if it is
(or is not) a specific type (such as ppPlaceholderBody). But I can't figure
out how to "take attendance". Is there some sort of "if this placeholder
format is/is not represented on this notes master then..." routine/structure
I can use?

I have searched http://www.pptfaq.com (and the Internet in general) but
can't seem to find quite what I need. I'm hoping someone has done something
like this before and can point me to an example. If not, then a hint as to
how to approach this would help too.
 
Simplest way I know is:

Sub RestoreNotesMaster()
' If you try to add a placeholder that's already there
' PowerPoint will throw an error. Tell it to ignore errors:
On Error Resume Next

With ActivePresentation.NotesMaster.Shapes
' Body text
.AddPlaceholder (ppPlaceholderBody)
' Slide image (on notes master, it's the Title placeholder)
.AddPlaceholder (ppPlaceholderTitle)
' etc
End With

End Sub
 
Ah-ha! The key piece of information I was missing was that PowerPoint WON'T
add a placeholder to the NotesMaster if that placeholder is already
represented on the NotesMaster. Thank you for clarifying.
 
Ah-ha! The key piece of information I was missing was that PowerPoint WON'T
add a placeholder to the NotesMaster if that placeholder is already
represented on the NotesMaster. Thank you for clarifying.

No problem. The same is true of most other placeholders on slides, masters, etc.
by the way.
 
Back
Top