PowerPoint, a powerful tool introduced by microsoft corporation for making beautiful presentations. The tool also got quite good design and interfaces for both newbies and experts and is being used in almost every domain.

Microsoft has also given the support to the developers to develop their own Add-INs to make the life easier For instance you are a lecturer and you have to write your email id, name and website etc on each slide every time you create a new presentation. Then don’t you think there should be any plugin which automatically add such stuff whenever you start an application? If you think so then don’t worry i will help you in developing your own PowerPoint Add Ins.

Lets start PowerPoint Addins Development with the example i discussed above and follow the steps with me:

  1. Open Visual Studio and create a new Office Project by selecting  Visual C# -> Office/Sharepoint -> PowerPoint 2013 Add-in as shown below :
    Power Point Add-in Development 1
  2. Now open ThisAddIn.cs class/file from your solution explorer and register a New Presentation Slide event inside ThisAddIn_Startup method as shown below:
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
     this.Application.PresentationNewSlide += Application_PresentationNewSlide;
  3. Now you have registered an event that will be initialize and triggered every time you create a new slide but how we can assign some functionality to that event so that it works according to our need? The answer is add the functionality to its Registered Function that will be triggered when the event occurs and you can add that by adding following method in your class :
     void Application_PresentationNewSlide(PowerPoint.Slide Sld)
     PowerPoint.Shape textbox = Sld.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal,0,0,500,50);
    textbox.TextFrame.TextRange.InsertAfter("Being Presented By: M Bilal Amjad\nMicrosoft Certified Professional\nwww.bilalamjad.pw");

    The above mentioned code is self explanatory as in line 1 PowerPoint.Shape textbox is creating a new PowerPoint.Shape instance with name textbox which will help us to invoke parent class’ functions that is PowerPoint.Shape.Then We have invoked Sld.Shapes.AddTextBox() function where Sld is is an instance of PowerPoint.Slide Class which has been passed to this event handler as an argument in ThisAddIn_Startup method discussed in step 1. This functions needs 5 parameters to work i.e. Text Orientation , Position according to +x,-x,+y and -y coordinates.
    After that we have invoked PowerPoint.Shape.TextFrame.TextRange.InsertAfter() method through its instance textbox and have wrote our information in it.

  4. That’s All you have now created a plugin/Add-in that will add your desired information on every slide of your new presentation and will help you to save your time from copy/pasting the information from one slide to another or writing the information again & again. Final preview after building and running the application according to above example will be as follow :
    PowerPoint Add-in 2

Start playing around with the code and make a good Add-IN.

Practice Activity: Create a Add-in using above example that asks the user what information he want to use every time he create a new slide then place it at the bottom of each slide.