private void btn_ok_Click(object sender, EventArgs e) { int test5 = comboBox1.SelectedIndex; string test2 = comboBox1.GetItemText(comboBox1.SelectedItem); System.Diagnostics.Debug.WriteLine("comboBox1.SelectedIndex : " + test5); System.Diagnostics.Debug.WriteLine("comboBox1.GetItemText(comboBox1.SelectedItem) : " + test2); try { string test1 = Doc.Variables["pageTemplate"].Value; Doc.Variables["pageTemplate"].Value = comboBox1.GetItemText(comboBox1.SelectedItem); } catch { Doc.Variables.Add("pageTemplate", comboBox1.GetItemText(comboBox1.SelectedItem)); } if (radioButton1.Checked) { Doc.Variables["processType"].Value = "styles"; if (H2.SelectedIndex != I2.SelectedIndex && I2.SelectedIndex != A2.SelectedIndex) { if (H2.SelectedIndex != A2.SelectedIndex) { Doc.Variables["heading2_name"].Value = H2.Items[H2.SelectedIndex].ToString(); if (checkBox1.Checked) { Doc.Variables["introduction2"].Value = I2.Items[I2.SelectedIndex].ToString(); } else { Doc.Variables["introduction2"].Value = "Empty"; } if (checkBox3.Checked) { Doc.Variables["appendix2"].Value = A2.Items[A2.SelectedIndex].ToString(); } else { Doc.Variables["appendix2"].Value = "Empty"; } MyRibbon.changeStyles(Doc); this.Close(); this.Dispose(); return; } } MessageBox.Show("Value mistake - All styles must be different"); } else { Doc.Variables["processType"].Value = "pages"; MyRibbon.changeStyles(Doc); this.Close(); this.Dispose(); } }
private void button1_Click(object sender, EventArgs e) { MyRibbon.moveToNewVersion(Doc); this.Close(); this.Dispose(); }
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject() { m_Ribbon = new MyRibbon(); return(m_Ribbon); }