private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (wordInstance != null) { wordInstance.Leave(tbName.Text); } }