Select Page

In this LinkedIn discussion, the question was asked “how can I set the title text to use sentence case across a large presentation”.

The macro below does just that. You can add it to your presentation by pressing Alt+F11 and inserting a new module into your VBA project before pasting the code (and the credit please)!

Then, once back in your presentation, simply press Alt+F8 and select the macro to run it.

Check out our blog for more PowerPoint automation tips and our commercial add-ins to make creating compelling content easier and more fun. We also develop custom macros and add-ins!

' VBA Macro for PowerPoint to reset all title placehlders to sentence case
'----------------------------------------------------------------------------------
' Copyright (c) 2014 YOUpresent Ltd.
' Source code is provide under Creative Commons Attribution License
' This means you must give credit for our original creation in the following form:
' "Includes code created by YOUpresent Ltd. (youpresent.co.uk)"
' Commons Deed @ http://creativecommons.org/licenses/by/3.0/
' License Legal @ http://creativecommons.org/licenses/by/3.0/legalcode
'----------------------------------------------------------------------------------
' Purpose : Sets the text for the title placeholder for all slides in the current presentation to sentence case
'
' Author : Jamie Garroch
' Date : 09AUG2014
' Website : http://youpresent.co.uk and http://www.gmark.co
'----------------------------------------------------------------------------------

Option Explicit

Public Sub SetTitlesToSentenceCase()
  Dim oSld As Slide
  Dim oShp As Shape
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Type = msoPlaceholder Then
        If oShp.PlaceholderFormat.Type = ppPlaceholderTitle Then
          If oShp.HasTextFrame Then
            If oShp.TextFrame.HasText Then
              oShp.TextFrame.TextRange.ChangeCase ppCaseSentence
            End If
          End If
        End If
      End If
    Next
  Next
End Sub