M
Marc Ridey
To bring it down to a simple problem.
As soon as I access the VBProject property of a presentation, later on when
I close PowerPoint, I get an Exception.
To reproduce:
Environment: VS.NET 2003, Office 2003, OS either Server2003 or XPPro.
1. Open VS.NET 2003
2. Create a new "C# shared addin for PowerPoint"
3. Add "Microsoft.Office.Interop.Powerpoint" and "Microsoft.Vbe.Interop"
assemblies
4. Add a blank form, Form1
5. Add a button on the form
6. Add an instance of the form in Connect.cs
7. Pass the PowerPoint application hadnle to the form in OnConnection and
show the form.
8. In the button handler, add one line "if (app.ActivePresentation.VBProject
== null) return;
Yes, the line does nothing, it's just a mean to trigger an access to the
property VBProject.
Now, build the project, build the setup, run the setup, run powerpoint.
You should get your non-modal form displayed when powerpoint starts.
With a presentation opened (even a blank one), press the button to trigger
an access to VBProject.
Close the presentation
Close Powerpoint
When I close PowerPoint, a few seconds later, I get an exception.
Marc
As soon as I access the VBProject property of a presentation, later on when
I close PowerPoint, I get an Exception.
To reproduce:
Environment: VS.NET 2003, Office 2003, OS either Server2003 or XPPro.
1. Open VS.NET 2003
2. Create a new "C# shared addin for PowerPoint"
3. Add "Microsoft.Office.Interop.Powerpoint" and "Microsoft.Vbe.Interop"
assemblies
4. Add a blank form, Form1
5. Add a button on the form
6. Add an instance of the form in Connect.cs
7. Pass the PowerPoint application hadnle to the form in OnConnection and
show the form.
8. In the button handler, add one line "if (app.ActivePresentation.VBProject
== null) return;
Yes, the line does nothing, it's just a mean to trigger an access to the
property VBProject.
Now, build the project, build the setup, run the setup, run powerpoint.
You should get your non-modal form displayed when powerpoint starts.
With a presentation opened (even a blank one), press the button to trigger
an access to VBProject.
Close the presentation
Close Powerpoint
When I close PowerPoint, a few seconds later, I get an exception.
Marc