none
controlling powerpoint using C# RRS feed

  • Question

  • Hi I wanted to create a presentation and change the slides all using C# code.. how to do that?
    Thursday, September 15, 2011 4:11 AM

Answers

  • I think you need to formulate your question in smaller "chunks" and more detail. These forums aren't here to teach you the entire object model in one go...  When you ask questions, please specify the version of PowerPoint you're working with.

    You need to set a reference to the PowerPoint PIA in your project. It helps to place a using statement at the top of the class "page" so that you don't have to type out the namespace qualification for each call to the PowerPoint object model.

    using ppt = Microsoft.Office.Interop.PowerPoint;

    A presentation is created by instantiating a new instance of the PowerPoint application then using the method pptApp.Presentations.Add

    ppt.Application ppApp = new ppt.Application();
    ppt.Presentation = ppApp.Presentations.Add(//some parameters required here);


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bruce Song Friday, September 23, 2011 1:37 AM
    Thursday, September 15, 2011 6:10 AM
    Moderator
  • Here's a similar thread that I think might help you:
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/627d8e1b-854b-47ec-8e0b-6790f2accec8/

    Please revert back here if this does not help, hopefully someone will be able to answer that then.


    Kunal D Mehta - a Windows Server Enthusiast | My first TechNet Wiki Article
    • Marked as answer by Bruce Song Friday, September 23, 2011 1:37 AM
    Thursday, September 15, 2011 1:06 PM

All replies

  • I think you need to formulate your question in smaller "chunks" and more detail. These forums aren't here to teach you the entire object model in one go...  When you ask questions, please specify the version of PowerPoint you're working with.

    You need to set a reference to the PowerPoint PIA in your project. It helps to place a using statement at the top of the class "page" so that you don't have to type out the namespace qualification for each call to the PowerPoint object model.

    using ppt = Microsoft.Office.Interop.PowerPoint;

    A presentation is created by instantiating a new instance of the PowerPoint application then using the method pptApp.Presentations.Add

    ppt.Application ppApp = new ppt.Application();
    ppt.Presentation = ppApp.Presentations.Add(//some parameters required here);


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bruce Song Friday, September 23, 2011 1:37 AM
    Thursday, September 15, 2011 6:10 AM
    Moderator
  • Here's a similar thread that I think might help you:
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/627d8e1b-854b-47ec-8e0b-6790f2accec8/

    Please revert back here if this does not help, hopefully someone will be able to answer that then.


    Kunal D Mehta - a Windows Server Enthusiast | My first TechNet Wiki Article
    • Marked as answer by Bruce Song Friday, September 23, 2011 1:37 AM
    Thursday, September 15, 2011 1:06 PM
  • Hi Shanuapril,

    How about the problem on your side? If you still need any assistant, just feel free to let us know.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, September 21, 2011 2:04 AM
  • Actually i am having the same problem. I want to open a powerpoint presentation in a c# application and control it with some custom gestures using kinect. But i can't even find out how to open a presentation inside my application
    Tuesday, January 29, 2013 12:31 PM