VBA to Ungroup All PowerPoint Shapes in All Slides
<p>I have a macros that is unfortunately skipping all grouped shapes in PowerPoint where the text requires to be normalized (hard returns swapped with spacemarks). Now, I wrote a 'prepping' script that should find all shapes with text and ungroup those. For some reason it is not working. This should be so simple, yet I cannot get it to work. Please help!</p>

<pre><code>Sub Ungroupallshapes()
    Dim osld As Slide
    Dim oshp As Shape
    For Each osld In ActivePresentation.Slides
        For Each oshp In osld.Shapes
            If oshp.Type = msoGroup Then
                If oshp.HasTextFrame Then
                    If oshp.TextFrame.HasText Then oshp.Ungroup
                    End If
                End If
        Next oshp
    Next osld
End Sub
</code></pre>

<p>Thank you!</p>