title: Existence of shapes in Powerpoint
body: <p>I would like to build a condition on a command button on a Macro enabled powerpoint presentation. If the shape exists then I would like it deleted, otherwise the button should produce a statement about the fact that there is no such shape. Currently I am having trouble with existence...! How do I get Power point to recognise the shape is null? Here is my code:</p>
  
  <pre><code>If ActivePresentation.Slides(3).Shapes("Picture") Is Nothing Then
    MsgBox "no Picture"
  Else
    ActivePresentation.Slides(3).Shapes("Picture").Delete
    MsgBox "Picture Cleared"
  End If
  </code></pre>
  
  <p>This code only produces an error because the shape doesn't exist so the first if statement fails. Perhaps we need to check whether its in the selection pane?</p>