title: I have two shapes selected in VBA for powerpoint 2010, how do I create some sort of data structure out of them
body: <p>I am trying to create a memory game similar to the one here: <a href="http://www.mathsisfun.com/games/memory/index.html" rel="nofollow">http://www.mathsisfun.com/games/memory/index.html</a>. I am approaching it like this:</p>
  
  <p>The user selects two shapes and then starts a macro named associateShapes(),
  In associateShapes I use a Class Module named ShapeAssociation, in it I have two properties shape1Name and shape2Name, where the pair represents an association between those the shapes of those names.</p>
  
  <p>So when I try to test ShapeAssociation, I use this module:</p>
  
  <pre><code>Global shapeAssociations() As ShapeAssociation
  Global shapeAssoc As New ShapeAssociation
      Public Sub Test()
          ReDim shapeAssociations(0)
          shapeAssoc.shape1Name = ActiveWindow.Selection.ShapeRange(1).Name
          shapeAssoc.shape2Name = ActiveWindow.Selection.ShapeRange(2).Name
  
          Set shapeAssociations(0) = shapeAssoc
          MsgBox shapeAssociations(0).shape1Name
      End Sub
  </code></pre>
  
  <p>However, the Message Box I end up seeing is empty, possibly indicating that the shapeAssoc variable hasn't been initialized. I have tried several other approaches for creating a data structure of pairs of shapes in VBA, from a multiple dimension array of shapes to this approach. All these attempts bring their own error messages, be it compile time messages or run time messages. So my question to you is, how do I create a data structure in VBA that represents a pair of Shapes?</p>