title: PowerPoint VBA/Custom UI XML: toggle/checkbox getPressed dynamic update
body: <p>I am trying to include a button for both textwrapping for textboxes and locking the aspect ratio of a shape. I am able to get the buttons to work on its own but I can't seem to get the getPressed value to reflect the initial state of the shape.</p>
  <p>i.e. if a shape already have <code>.LockAspectRatio = True</code>, and i select it, the custom button's getPressed attibute doesn't change to True. The sub still runs when I press the button, it's a simple line of <code>.LockAspectRatio = not .LockAspectRatio</code>, but it just looks silly having the button  on the ribbon shown as 'pressed', but the actual attibute for the shape is False.</p>
  <p>My question is how do I get the getPressed value to reflect the shape's intial value, and have this shown in the ribbon.</p>
  <p>I've gathered from other posts that there is need for a sub to address the ribbon but I am unsure of the purpose of this, below is what I have so far.</p>
  <pre><code>Option Explicit
  
  Public isPressed As Boolean
  Public myRibbon As IRibbonUI
  
  Sub toggleAR(ribbon As IRibbonUI)
      
      Set myRibbon = ribbon
          
  End Sub
  
  Sub getPressedAR(control As IRibbonControl, ByRef returnedVal)
  
      Select Case control.Id
          Case &quot;AspectRatio&quot;
              returnedVal = isPressed
      End Select
  
  End Sub
  
  Sub AspectRatio(control As IRibbonControl, pressed As Boolean)
      
      Select Case control.Id
          Case &quot;AspectRatio&quot;
              If ActiveWindow.Selection.ShapeRange.LockAspectRatio = msoTrue Then
                  isPressed = True
              Else
                  isPressed = False
              End If
              ActiveWindow.Selection.ShapeRange.LockAspectRatio = Not ActiveWindow.Selection.ShapeRange.LockAspectRatio
      End Select
      
  End Sub
  </code></pre>
  <p>Thanks in advance</p>