/// <summary> /// SABボタン押下処理 /// </summary> private void buttonSAB_Click(object sender, RibbonControlEventArgs e) { try { // 現在開いているファイルを確認 int iOpenFileCnt = 0; Excel.Application ExcelApp = (Excel.Application)global::ExcelAddInSAB.Globals.ThisAddIn.Application; iOpenFileCnt = ExcelApp.Workbooks.Count; if (iOpenFileCnt == 0) { return; } // 言語設定を取得 string currentUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture.ToString(); // プロパティ情報取得 SettingForm settingForm = new SettingForm(); // 共通設定エラー時処理 if (settingForm.commonFileReadCompleted == false) { return; } // 共通設定ファイルと言語設定が異なる場合は言語設定を反映 string strCulture = settingForm.clsCommonSettting.strCulture; if (currentUICulture != strCulture) { System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.GetCultureInfo(strCulture); System.Threading.Thread.CurrentThread.CurrentUICulture = culture; settingForm = new SettingForm(); } // プロパティのセキュリティ情報が存在するか if (settingForm.IsSecrecyInfoRegistered() == true) { string filePropertySecrecyLevel = string.Empty; // ファイルプロパティ情報 機密区分 string filePropertyClassNo = string.Empty; // ファイルプロパティ情報 文書No. string filePropertyOfficeCode = string.Empty; // ファイルプロパティ情報 事業所コード // ファイルプロパティ情報取得 settingForm.GetDocumentProperty(ref filePropertySecrecyLevel, ref filePropertyClassNo, ref filePropertyOfficeCode); // プロパティ情報があればインフォメーション画面表示 AddInsLibrary.InfomationForm infomationForm = new AddInsLibrary.InfomationForm(filePropertySecrecyLevel); // SAB機密区分表示画面を表示 System.Windows.Forms.DialogResult dialogResult = infomationForm.ShowDialog(); // 修正ボタンが押されたら設定画面を表示 if (dialogResult == System.Windows.Forms.DialogResult.OK) { settingForm.ShowDialog(); } } else { // プロパティ情報がなければ設定画面表示 settingForm.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), AddInsLibrary.Properties.Resources.msgError, MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
public void buttonSAB_Click(Office.IRibbonControl control) { // 現在開いているファイルを確認 int iOpenFileCnt = 0; PowerPoint.Application pptApp = (PowerPoint.Application)global::PowerPointAddInSAB.Globals.ThisAddIn.Application; iOpenFileCnt = pptApp.Presentations.Count; if (iOpenFileCnt == 0) { return; } // 言語設定を取得 string currentUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture.ToString(); // プロパティ情報取得 SettingForm settingForm = new SettingForm(); settingForm.propPres = pptApp.ActivePresentation; // 共通設定エラー時処理 if (settingForm.commonFileReadCompleted == false) { return; } // 共通設定ファイルと言語設定が異なる場合は言語設定を反映 string strCulture = settingForm.clsCommonSettting.strCulture; if (currentUICulture != strCulture) { System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.GetCultureInfo(strCulture); System.Threading.Thread.CurrentThread.CurrentUICulture = culture; settingForm = new SettingForm(); } // プロパティのセキュリティ情報が存在するか if (settingForm.IsSecrecyInfoRegistered() == true) { string filePropertySecrecyLevel = string.Empty; // ファイルプロパティ情報 機密区分 string filePropertyClassNo = string.Empty; // ファイルプロパティ情報 文書No. string filePropertyOfficeCode = string.Empty; // ファイルプロパティ情報 事業所コード // ファイルプロパティ情報取得 settingForm.GetDocumentProperty(ref filePropertySecrecyLevel, ref filePropertyClassNo, ref filePropertyOfficeCode); // プロパティ情報があればインフォメーション画面表示 AddInsLibrary.InfomationForm infomationForm = new AddInsLibrary.InfomationForm(filePropertySecrecyLevel); // SAB機密区分表示画面を表示 System.Windows.Forms.DialogResult dialogResult = infomationForm.ShowDialog(); // 修正ボタンが押されたら設定画面を表示 if (dialogResult == System.Windows.Forms.DialogResult.OK) { settingForm.ShowDialog(); } } else { // プロパティ情報がなければ設定画面表示 settingForm.ShowDialog(); } }