Beispiel #1
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            PLLog.Trace("Enter", Common.PROJECT_NAME);

            Globals.Ribbons.Ribbon.chkDisplayEvents.Checked   = Common.DisplayEvents;
            Globals.Ribbons.Ribbon.chkEnableAppEvents.Checked = Common.HasAppEvents;

            try
            {
                if (Common.HasAppEvents)
                {
                    Common.AppEvents = new Events.ProjectAppEvents();
                    Common.AppEvents.ProjectApplication = Globals.ThisAddIn.Application;
                }

                Common.ProjectHelper.ProjectApplication = Globals.ThisAddIn.Application;

                // Need to do a bit more work to use CustomTask Panes in Project.  (Handled by Designer normally)

                CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
            }
            catch (Exception ex)
            {
                PLLog.Error(ex, Common.PROJECT_NAME);
            }

            PLLog.Trace("Exit", Common.PROJECT_NAME);
        }
Beispiel #2
0
        // TODO:  Follow these steps to enable the Ribbon (XML) item:

        // 1: Copy the following code block into the ThisAddin, ThisWorkbook, or ThisDocument class.

        protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
        {
            //currentPresentation = Application.ActivePresentation as PowerPoint.Presentation;
            myCustomTaskPanes = this.CustomTaskPanes as Microsoft.Office.Tools.CustomTaskPaneCollection;
            PowerPoint.Application app = this.Application as Microsoft.Office.Interop.PowerPoint.Application;
            return(new Ribbon());
        }
Beispiel #3
0
        public void CreateCustomPanel()
        {
            myUserControl1             = new CustomPanel();
            addTask                    = new AddTaskPanel();
            myCustomTaskPaneCollection = Globals.Factory.CreateCustomTaskPaneCollection
                                             (null, null, "CustomTaskPanes", "CustomTaskPanes", this);

            myCustomTaskPane         = myCustomTaskPaneCollection.Add(myUserControl1, "插件面板");
            myCustomTaskPane.Visible = true;
        }
Beispiel #4
0
 public TestXMLRibbon(Microsoft.Office.Tools.CustomTaskPaneCollection myCustomTaskPanes, Application application)
 {
     this.myCustomTaskPanes = myCustomTaskPanes;
     this.app = application;
 }