ThisAddIn.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Xml.Linq;
  6. using Word = Microsoft.Office.Interop.Word;
  7. using Office = Microsoft.Office.Core;
  8. using Microsoft.Office.Tools.Word;
  9. using Microsoft.Office.Core;
  10. using System.Windows.Forms;
  11. using Microsoft.Office.Tools;
  12. using Microsoft.Office.Tools.Ribbon;
  13. namespace HTEXLabel
  14. {
  15. public partial class ThisAddIn
  16. {
  17. private void ThisAddIn_Startup(object sender, System.EventArgs e)
  18. {
  19. KnowledgeUserControl knowledgeUserControl = new KnowledgeUserControl();
  20. Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane =
  21. this.CustomTaskPanes.Add(knowledgeUserControl, "My Custom Task Pane");
  22. // 可选:设置自定义功能面板的属性
  23. myCustomTaskPane.Visible = true;
  24. }
  25. private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
  26. {
  27. }
  28. protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
  29. {
  30. //return Globals.Factory.GetRibbonFactory().CreateRibbonManager(new Microsoft.Office.Tools.Ribbon.IRibbonExtension[] { });
  31. return new LableRibbon();
  32. }
  33. #region VSTO 生成的代码
  34. /// <summary>
  35. /// 设计器支持所需的方法 - 不要修改
  36. /// 使用代码编辑器修改此方法的内容。
  37. /// </summary>
  38. private void InternalStartup()
  39. {
  40. this.Startup += new System.EventHandler(ThisAddIn_Startup);
  41. this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
  42. }
  43. #endregion
  44. }
  45. }