title: Get customized togglebutton in outlook addin
body: <p>Hi I develop an addin for outlook where I want to add a new customized toggle button in the appointment tab. When I save the appointment I want to get the current state of the toggle button.
  This is my code so far: </p>
  
  <p>So the button is already created, but when I press save, I can't get the button control.
    Ribbon1.xml:</p>
  
  <pre><code>&lt;tab idMso="TabAppointment"&gt;
          &lt;group id="SalesforceGroup" label="Salesforce"&gt;
            &lt;toggleButton id="ImportToSalesforce" size="large"
              label="Import to Salesforce" imageMso="DatabaseInsert"
              getPressed="GetPressed"
              onAction="Salesforce_Click"  /&gt;
          &lt;/group&gt;
        &lt;/tab&gt;
  </code></pre>
  
  <p>Ribbon1.vb:</p>
  
  <pre><code>Public Sub GetPressed(ByVal control As Office.IRibbonControl)
          MsgBox("test")   ' This alert only pops up when the appointment window opens
      End Sub
  
  Public Sub Salesforce_Click(ByVal control As Office.IRibbonControl)
      MsgBox("test")    ' This alert never pops up
  End Sub
  </code></pre>
  
  <p>ThisAddIn.vb:</p>
  
  <pre><code>Private Sub inspectors_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles inspectors.NewInspector
      If TypeName(Inspector.CurrentItem) = "AppointmentItem" Then
          MsgBox("event")
          oAppointmentItem = TryCast(Inspector.CurrentItem, Outlook.AppointmentItem)
          AddHandler oAppointmentItem.Write, AddressOf Item_Save
      End If
  End Sub
  
  Private Sub Item_Save(ByRef Cancel As Boolean)
    'get IRibbonControl
  End Sub
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  Fixed the problem, that my onAction function never get called, because the parameter wasn't set right:
  Ribbon1.vb:</p>
  
  <pre><code>Public Sub Salesforce_Click(ByVal control As Office.IRibbonControl, _
      ByVal isPressed As Boolean)
      MsgBox("test2")
  End Sub
  </code></pre>
  
  <p>But the main question is: how to get the state of the toogle button when the user press save?</p>