Unable to create multiple PowerPoint instances

I am working on a project where I need to use PowerPoint from C # .net. Initially, I always created one instance. Today I would like to run several instances. I do it like this:

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

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

but when I request a handle to both instances, calling

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

then i get the same descriptor twice. I came to the conclusion that the application is launched only once, and the TaskManager confirms the following: Only one process.

How is it that only one instance of PowerPoint works, and how can I get it to work?

+5
source share
5 answers

, ?

" ", , PPT , .

+4
+4

PowerPoint, Word . Excel, , . , .

? ?

+2

Mikael, . VBA, #. () PNG. PNG .

Dim ap As Presentation
Set ap = Presentations.Open(FileName:="yourppt.pptx", WithWindow:=msoFalse)
Dim s As Slide
For Each s In ap.Slides
    s.Export s.Name, "PNG"
Next

, - -, , PPT .

+1

2007 ppt (x) pdf

pdf

.doc( Acrobat Pro - 9.5.2);.doc , , , , .doc .ppt(x):-)

BTW - Word 2007 , , , -.

-1
source

All Articles