title: check whether a shape is a group (GroupItems raises an error)
body: <p>I was trying the following code in Word:</p>
  
  <pre><code>Sub MyMacro()
  
  Dim sh1 As Shape
  
  For Each sh1 In ActiveDocument.Shapes
   If sh1.GroupItems.Count &gt; 0 Then
    Debug.Print sh1.Name + " is a group!"
    Else: Debug.Print sh1.Name + " is not a group!"
   End If
  Next
  
  End Sub
  </code></pre>
  
  <p>For the actual grouped shape it works, but when the shape is not a group, I get an error:</p>
  
  <blockquote>
    <p>Run-time error '-2147024891 (80070005)': This member can only be
    accessed for a group</p>
  </blockquote>
  
  <p>How can I check if the object is a group, besides using <code>On Error</code>?</p>