title: How to exit a VBA macro when the form's "X" button is clicked?
body: <p>I have an Outlook macro that pops up a form when someone sends an email and asks them to select a classification. Under ThisOutlookSession I have:</p>
  
  <pre><code>Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  
            Dim frm As classificationForm
            Dim chosenvalue As String
  
            Set frm = New classificationForm
            frm.Show vbModal
  
            Select Case True
            Case frm.restrictedButton.Value
              chosenvalue = "Restricted"
            Case frm.internalButton.Value
              chosenvalue = "Internal"
            Case frm.publicButton.Value
              chosenvalue = "Public"
            Case Else
              MsgBox "No classification chosen"
              Cancel = True
              Exit Sub
            End Select
  
      If TypeName(Item) = "MailItem" Then
        Item.Subject = "[" &amp; chosenvalue &amp; "] " &amp; Item.Subject
      End If
  
  End Sub
  </code></pre>
  
  <p>and under classificationForm I have:</p>
  
  <pre><code>Private Sub okCommand_Click()
    Unload Me
  End Sub
  
  Private Sub cancelCommand_Click()
    Unload Me
  End Sub
  </code></pre>
  
  <p>The form is 3 option buttons (the classifications) and 2 command buttons (OK and Cancel).</p>
  
  <p>The [Internal] option button is selected by default. However, if someone clicks the form's "X" button in the top-right corner or the "Cancel" command button, then the Macro sends the email with the selected classification button when I want it to kick me back to the draft email like it would if there were no options selected.</p>
  
  <p>How would I do this? Thanks.</p>