none
cannot refresh power point addin in new presentation RRS feed

  • General discussion

  • Hi,

    I am unable to refresh my addin data after opening new presentation from the existed presentation.

    My addin contains a file browse and a tree view which will be populated by the file name ranges.

    This data is not clearing evn after opening new presentation.

    this is th code i written for this

     

       private ProjectStatusOverview uc;
    
            private Microsoft.Office.Tools.CustomTaskPane myTaskPane;
    
            private Microsoft.Office.Tools.CustomTaskPaneCollection myCustomTaskPaneCollection;
    
    
    
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
    
            {
    
                this.Application.AfterNewPresentation += new Microsoft.Office.Interop.PowerPoint.EApplication_AfterNewPresentationEventHandler(Application_AfterNewPresentation);
    
                this.Application.PresentationNewSlide += new Microsoft.Office.Interop.PowerPoint.EApplication_PresentationNewSlideEventHandler(Application_PresentationNewSlide);
    
                uc = null;
                uc = new ProjectStatusOverview();
    
                myCustomTaskPaneCollection =
    
              new Microsoft.Office.Tools.CustomTaskPaneCollection
    
                    (this.ItemProvider, this.HostContext, "MyTaskPane", this, "MyTaskPane");
    
    
                int add_in_num = this.CustomTaskPanes.Count;
    
                if (add_in_num == 0)
    
                {
    
                    myTaskPane = myCustomTaskPaneCollection.Add(uc, "Select Column");
    
                    myTaskPane.Visible = true;
    
                }
    
                else
    
                {
    
                    this.CustomTaskPanes[0].Visible = true;
    
                }
    
    
    
            }
    
    
    
            void Application_AfterNewPresentation(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
    
            {
    
    
    
                //if (uc.tvNamedRanges.Nodes.Count > 0)
    
                //    uc.tvNamedRanges.Nodes.Clear();
    
                //uc.txtFilePath.Text = string.Empty;
    
                //uc = null;
    
                //uc = new ProjectStatusOverview();
    
                //uc.ResetText();
    
                //int add_in_num = this.CustomTaskPanes.Count;
    
    
    
                //if (add_in_num == 0)
    
                //{
    
                //    myTaskPane = this.CustomTaskPanes.Add(uc, "Select Column");
    
                //    myTaskPane.Visible = true;
    
                //}
    
                //else
    
                //{
    
                //    this.CustomTaskPanes[0].Visible = true;
    
                //}
    
            }
    
            void ThisAddIn_NewPresentation(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
    
            {
    
                uc = null;
    
                uc = new ProjectStatusOverview();
                Pres.Application.
                if (uc.tvNamedRanges.Nodes.Count > 0)
    
                    uc.tvNamedRanges.Nodes.Clear();
                uc.txtFilePath.Text = string.Empty;
    
                int add_in_num = this.CustomTaskPanes.Count;
                if (add_in_num == 0)
    
                {
    
                    myTaskPane = this.CustomTaskPanes.Add(uc, "Select Column");
    
                    myTaskPane.Visible = true;
    
                }
    
                else
    
                {
    
                    this.CustomTaskPanes[0].Visible = true;
    
                }
    
            }
    
            void Application_PresentationNewSlide(PowerPoint.Slide NewSlide)
    
            {
    • Changed type Bessie Zhao Thursday, April 8, 2010 2:04 AM
    Thursday, April 1, 2010 9:19 AM

All replies

  • Hello,

    From the code above, I am not able to run it in my side. Would you please share more code with us?

    <<I am unable to refresh my addin data after opening new presentation from the existed presentation.>>
    It will trigger AfterNewPresentation/NewPresentation events. In these events hander, it uses the member of this custom task pane. Without more information, it is really hard to reproduce this issue.

    <<My addin contains a file browse and a tree view which will be populated by the file name ranges.>>
    If I guess correctly, you defined file browser and tree view in the User Control. Would you please tell us more information for file name ranges?

    Best regards,
    Bessie 

    --------------------------------------------------------------------------------
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 2, 2010 9:26 AM