0

Another program, outside my own program, creates a new PowerPoint presentation. When it does, my program can detect the process ID of the PowerPoint presentation.

I want to take control of the currently running instance of PowerPoint so that I can copy slides or at least save the presentation. How would I do this in .NET?

Abel
  • 56,041
  • 24
  • 146
  • 247
blueshift
  • 831
  • 2
  • 12
  • 24
  • a powerpoint presentation is a file, not a process. – Daniel A. White Jan 17 '12 at 20:48
  • @DanielA.White: Thanks for the clarification. I meant that I want to take control of the current running instance of PowerPoint. How can this be done? – blueshift Jan 17 '12 at 20:52
  • @Daniel unless the powerpoint is run, or unless the powerpoint is converted to a standalone executable. Though I doubt that's what's meant here. – Abel Jan 17 '12 at 20:53

1 Answers1

2

powerpoint offers a large automation api utilizable though .net.

rerun
  • 25,014
  • 6
  • 48
  • 78
  • I concur. Working with any MS Office application can best be done through the large and mature API, as opposed to hacking your way in through low level system calls. – Abel Jan 17 '12 at 20:54
  • I agree that the API is a better way of automating Office apps, but in this situation, the PowerPoint application is started by Minitab which also creates the presentation and populates the slides. I am trying to automate the process of extracting the slides from this presentation and copying them into another presentation. – blueshift Jan 17 '12 at 20:58
  • @blueshift Have you tried it with the office interop API? I'm not sure but you may be able to attach to a running instance of PP. In fact I'd be surprised if it's not possible. – Igby Largeman Jan 17 '12 at 22:06
  • I found the answer in another SO post: [so]http://stackoverflow.com/questions/1118735/get-instance-of-excel-application-with-c-sharp-by-handle – blueshift Jan 17 '12 at 23:49