public void Exec(string cmdName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { try { handled = false; if ((executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)) { if (cmdName == addInInstance.ProgID + "." + Pdf_COMMAND_NAME) { SampleWizardPage page = new SampleWizardPage(applicationObject); if (page != null && !page.IsDisposed) page.ShowDialog(); handled = true; return; } } } catch (Exception) { } }