Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Created June 25, 2016 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joswr1ght/6b6d9878c4acd85a1a20f19ece99b56e to your computer and use it in GitHub Desktop.
Save joswr1ght/6b6d9878c4acd85a1a20f19ece99b56e to your computer and use it in GitHub Desktop.
PowerPoint macro to replace double empty paragraph markers
' Replace all double paragraph carriage returns in PowerPoint Notes.
' Also handles multiple Notes pages per slide.
Sub NotesFix()
Dim osld As Slide
Dim oshp As Shape
Dim strNotes As String
For Each osld In ActivePresentation.Slides
For Each oshp In osld.NotesPage.Shapes
If oshp.HasTextFrame Then
If oshp.TextFrame.HasText Then
' Replace \r\r with \r (PowerPoint doesn't use CRLF in notes, just CR -- go figure)
oshp.TextFrame.TextRange.Text = Replace(oshp.TextFrame.TextRange.Text, "!" & Chr(13) & Chr(13), "!" & Chr(13))
oshp.TextFrame.TextRange.Text = Replace(oshp.TextFrame.TextRange.Text, ". " & Chr(13) & Chr(13), "." & Chr(13))
oshp.TextFrame.TextRange.Text = Replace(oshp.TextFrame.TextRange.Text, "." & Chr(13) & Chr(13), "." & Chr(13))
oshp.TextFrame.TextRange.Font.Bold = False
oshp.TextFrame.TextRange.Font.Size = 10
End If
End If
Next oshp
Next osld
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment