Cannot create multiple instances of PowerPoint

Posted by Excel20 on Stack Overflow See other posts from Stack Overflow or by Excel20
Published on 2010-03-06T17:42:31Z Indexed on 2010/03/08 6:21 UTC
Read the original article Hit count: 773

Filed under:
|

I'm working on a project where I need to use PowerPoint from C#.net. Initially, I always created one single instance. As of today, I would like to have multiple instance running. I do that like so:

Type powerpointType = Type.GetTypeFromProgID("PowerPoint.Application");

object instance1 = Activator.CreateInstance(powerpointType);
object instance2 = Activator.CreateInstance(powerpointType);

but when I ask for the handle of both instances, by calling

hwnd = (int)powerpointType.GetProperty("HWND").GetValue(instance1, null);

then I get the same handle twice. My conclusion is that the application is started just once, and the TaskManager comfirms that: Only one process.

How come there is only one instance of PowerPoint running, and how can I make it work?

© Stack Overflow or respective owner

Related posts about c#

Related posts about powerpoint