This should get you started
Code:
Sub EmptyShapes()
Dim aShp As Shape, aShp2 As Shape
For Each aShp In ActiveDocument.Shapes
If aShp.TextFrame.HasText Then
aShp.Fill.Visible = False
ElseIf aShp.Type = msoGroup Then
For Each aShp2 In aShp.GroupItems
If aShp2.TextFrame.HasText Then
aShp2.Fill.Visible = False
End If
Next aShp2
End If
Next aShp
End Sub
This only does one level of grouping. You may need to rewrite it to use a recursive function in case there are nested groups (ie groups of groups).