0

I have created an application level Add-in for PowerPoint 2010/2013 using C# VSTO. The add-in is installed from msi installer file.

The problem is that after I uninstall the add-in from the control panel and open a new PowerPoint presentation, the ribbon tab is still visible with all the functionalities correctly working.

To remove the tab I have to do either of the following two things:

  1. Remove the add-in from the COM Add-ins list from the PowerPoint Developer tab.
  2. End the running instance of PowerPoint from Task Manager.

I have called the dispose methods(in ThisAddIn_Shutdown method) for all the initializations I have done in ThisAddIn_StartUp method but this is not helping.

private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
    {
        this.Application.WindowSelectionChange -= Application_WindowSelectionChange;
        this.Application.SlideSelectionChanged -= Application_SlideSelectionChanged;
        this.Application.SlideShowBegin -= Application_SlideShowBegin;
        this.Application.SlideShowEnd -= Application_SlideShowEnd;          
    }

Am I missing something?

Anyhelp is most welcome. Thanks!

gkb
  • 1,449
  • 2
  • 15
  • 30
  • Is PowerPoint running while you uninstall your plugin, or is your plugin still there when you start PowerPoint after your plugin is installed? If I'm not mistaken, the ribbon is shared across all PowerPoint windows (i.e. also all presentations). So as long as it has been loaded it will not be unloaded before you exit the current PowerPoint instance. – Gedde May 27 '14 at 12:13
  • Even if I close the current instance of the PowerPoint and then uninstall, then again if I open a new Presentation, I can see the tab. Also only one active PowerPoint presentation is there at a time. – gkb May 27 '14 at 12:19
  • Are you using RibbonX to modify the ribbon or are you creating UI using the older commandbars (which would put your toolbars/buttons on the Add-ins tab of the ribbon)? If the latter, you need to explicitly delete them when your add-in unloads. – Steve Rindsberg May 27 '14 at 13:47
  • Search in your registry for another entry of your addin and delete them. Powerpoint 2010 usually present in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\PowerPoint\Addins and HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\PowerPoint\Addins – Kiru May 27 '14 at 16:27
  • @SteveRindsberg - Hi Steve, actually I am using the Ribbon(Visual Designer) template for creating the ribbon. – gkb Jun 04 '14 at 12:20

1 Answers1

0

Finally was able to find out the cause. It was due to a few lines of custom code written in the InitializeComponent() method in the Ribbon.Designer.cs file.

Got rid of the problem when removed that piece of code.

gkb
  • 1,449
  • 2
  • 15
  • 30
  • can you please tellme what changes you did,cause am strucked in same problem – Dah Sra Sep 30 '14 at 08:31
  • You'll have to make sure if all the variables used in your code are getting disposed properly. In my case I was using the Application Version property of the PowerPoint and that was not getting disposed properly as I had used it inside the InitializeComponent() method in the Ribbon.Designer.cs file. It took a lot of time to figure this out by starting from scratch again to figure out at what time during the development, this issue was created. – gkb Sep 30 '14 at 09:47
  • http://stackoverflow.com/questions/26116448/how-to-enable-shutdownnotification-in-power-point-using-c-sharp – Dah Sra Sep 30 '14 at 09:56