Serving Industries Worldwide

Innovative Ways - Satisfied Clientele

How to build simple PowerPoint task pane add-in using Angular?


Listening is fun too.

Straighten your back and cherish with coffee - PLAY !

 
 

How_to_build_simple_PowerPoint_task_pane_add-in_using_Angular

Table of Content

Introduction

The office add-ins platform can be used to create solutions that enhance the functionality of office apps and interact with the content in documents. With Office Add-ins, you can extend and interact with word, Excel, PowerPoint, OneNote, Project, and Outlook with familiar web technologies like HTML, CSS, and JavaScript.

Office Add-ins can do essentially all of the functions that a webpage does in a browser.


Use the Add-ins platform in Office to

Add New functionality to office clients -

Bring in external data, automate Office documents, and offer third-party functionality in Office clients, among several other things. For example, Microsoft Graph API, to perform communication.

Create new interactive, rich objects that could be integrated into office documents -

Embed maps, charts, and collaborative visualizations in Excel spreadsheets and Presentation slides for customers to use.

PowerPoint add-ins

On multiple platforms, including Windows, iPad, Mac, and also the web, PowerPoint add-ins are used to provide appropriate analysis for your users' presentations. You can create one of two types of PowerPoint add-ins:

  1. Content add-ins enable you to also include dynamic HTML5 content in your presentations.
  2. Using task pane add-ins to bring in reference data or integrate data into the show via a service.

This blog will guide you through the process of creating a PowerPoint Add-in or Visual Studio for Office.

The Visual Studio process generates a Visual Studio solution, although the Yeoman generator produces a Node.js project that can be handled in Visual Studio Code or any other editor.

Create the add-in

Using the Yeoman generator for Office add-ins or Visual Studio, you can create an office add-in.

Visual Studio Code or any other editor can manage the Yeoman generator's Node.js project, whereas Visual Studio produces a Visual Studio solution.

The latest version of Yeoman and also the Yeoman generator for Office Add-ins are now released. Run the following code from the command prompt to install these tools globally.

npm install -g yo generator-office


To create the add-in project

To use the Yeoman generator to generate an add-in project, just use the following command.


yo office

To create your add-in project, execute the following information as necessary.

install_packages

 

The generator creates the project and deploys supporting Node components after you complete the wizard.

   

Explore the Project

Sample code for a basic task pane add-in is included in the add-in project you generated with the Yeoman generator.

Open the project in your code editor and browse over all the files listed below if you want to understand more about the components of your add-in project.

Proceed to the next section when you're ready to test your add-in.

  1. The ./manifest.xmlThe settings and capabilities of the add-in are specified by a file in the project's root directory.
  2. The ./src/taskpane/taskpane.html The HTML markup for the task pane is included in this file.
  3. The ./src/taskpane/taskpane.css The CSS for the task pane's content is contained in this file.
  4. The ./src/taskpane/taskpane.js The Office JavaScript API code in this file facilitates the communication between the task pane and the Office client application.
  5. Install the dependencies for your add-in in the project's root folder.
  6. npm install
  7. Run the following command in the root directory of your project to test our add-in in PowerPoint on a browser. When you perform this command, the local web server will start (if it’s not already working).
  8. Insert a new blank slide in PowerPoint, go to the Home tab, and then click the Show Taskpane button in the toolbar to keep bringing up the add-in task pane.

power_point_slide

[Image of PowerPoint slide]
 

power_point_slide2

[Image of PowerPoint slide]

Create the add-in project in Visual Studio

  1. In visual studio, create a New Project in Visual Studio.
  2. Using the search box, enter add-in. Select PowerPoint Web Add-in and then Next.
  3. Name your project and select create.
  4. Pick add new functions to PowerPoint in the building office add-in dialogue window, then finish to finish the project.
  5. Visual Studio generates a solution, as well as the solution's two projects, which are presented in the solution explorer.
 

Searching for Powerpoint Add-in Development Solutions?

Enquire Today.

 

Update the code

Home.html defines the HTML that will be presented in the task pane of the add-in.

Replace the

element in home.html with the following markup and save the file.
 <body class="ms-font-m ms-welcome">
&nbsp;&nbsp;&nbsp;&nbsp;<div id="content-header">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="padding">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h1>Welcome</h1>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;
<div id="content-main">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="padding">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>Select&nbsp;a&nbsp;slide&nbsp;and&nbsp;then&nbsp;choose&nbsp;the&nbsp;buttons&nbsp;to&nbsp;below&nbsp;to&nbsp;add&nbsp;content&nbsp;to&nbsp;it.</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<h3>Try&nbsp;it&nbsp;out</h3>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="ms-Button" id="insert-image">Insert&nbsp;Image</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="ms-Button" id="insert-text">Insert&nbsp;Text</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;</div></body>

 
[home.html]

Open the home.js file in the web application project's root folder.

The script for the add-in is provided in this file.

Save the file before replacing the entire contents with the code following.

  
  	&#39;use&nbsp;strict&#39;;
(function&nbsp;()&nbsp;{
&nbsp;Office.onReady(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(document).ready(function&nbsp;()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#39;#insert-image&#39;).click(insertImage);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#39;#insert-text&#39;).click(insertText);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;function&nbsp;insertImage()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office.context.document.setSelectedDataAsync(getImageAsBase64String(),&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;coercionType:&nbsp;Office.CoercionType.Image,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageLeft:&nbsp;50,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageTop:&nbsp;50,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageWidth:&nbsp;400
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;(asyncResult)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(asyncResult.status&nbsp;===&nbsp;Office.AsyncResultStatus.Failed)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(asyncResult.error.message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;
&nbsp;function&nbsp;insertText()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office.context.document.setSelectedDataAsync(&quot;Hello&nbsp;World!&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;(asyncResult)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(asyncResult.status&nbsp;===&nbsp;Office.AsyncResultStatus.Failed)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(asyncResult.error.message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;function&nbsp;getImageAsBase64String()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&#39;iVBORw0KGgoAAAANSUhEUgAAAZAAAAEFCAIAAABCdiZrA&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;}
})();

[home.js]

Open the home.css file in the web app project's folder.

This file contains the add-custom in's styles.

Save the file after replacing the entire contents with the following code.

  #content-header {
    background: #2a8dd4;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px; 
    overflow: hidden;
}

#content-main {
    background: #fff;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto; 
}
.padding {
    padding: 15px;
}
  
[home.css]

Update the manifest

In the add-in project, open the XML manifest file. The settings and capabilities of the add-in are described in this file.

The providername element has a placeholder value. Replace it with your name.

The Displayname object's defaultvalue parameter has a placeholder. Replace it with a Ppt taskpane add-in.

 John Doe
en-US



 
[manifest.xml]

output

[output:1]

Conclusion

PowerPoint is a magnificent platform that used by thousands of businesses. Therefore, creating custom functionalities to swift operations is imperious. In this blog, we have learned how to create an add-in for PowerPoint and efficiently enhance new features.

How to build simple PowerPoint task pane add-in using Angular?

How_to_build_simple_PowerPoint_task_pane_add-in_using_Angular

Table of Content

Introduction

The office add-ins platform can be used to create solutions that enhance the functionality of office apps and interact with the content in documents. With Office Add-ins, you can extend and interact with word, Excel, PowerPoint, OneNote, Project, and Outlook with familiar web technologies like HTML, CSS, and JavaScript.

Office Add-ins can do essentially all of the functions that a webpage does in a browser.


Use the Add-ins platform in Office to

Add New functionality to office clients -

Bring in external data, automate Office documents, and offer third-party functionality in Office clients, among several other things. For example, Microsoft Graph API, to perform communication.

Create new interactive, rich objects that could be integrated into office documents -

Embed maps, charts, and collaborative visualizations in Excel spreadsheets and Presentation slides for customers to use.

PowerPoint add-ins

On multiple platforms, including Windows, iPad, Mac, and also the web, PowerPoint add-ins are used to provide appropriate analysis for your users' presentations. You can create one of two types of PowerPoint add-ins:

  1. Content add-ins enable you to also include dynamic HTML5 content in your presentations.
  2. Using task pane add-ins to bring in reference data or integrate data into the show via a service.

This blog will guide you through the process of creating a PowerPoint Add-in or Visual Studio for Office.

The Visual Studio process generates a Visual Studio solution, although the Yeoman generator produces a Node.js project that can be handled in Visual Studio Code or any other editor.

Create the add-in

Using the Yeoman generator for Office add-ins or Visual Studio, you can create an office add-in.

Visual Studio Code or any other editor can manage the Yeoman generator's Node.js project, whereas Visual Studio produces a Visual Studio solution.

The latest version of Yeoman and also the Yeoman generator for Office Add-ins are now released. Run the following code from the command prompt to install these tools globally.

npm install -g yo generator-office


To create the add-in project

To use the Yeoman generator to generate an add-in project, just use the following command.


yo office

To create your add-in project, execute the following information as necessary.

install_packages

 

The generator creates the project and deploys supporting Node components after you complete the wizard.

   

Explore the Project

Sample code for a basic task pane add-in is included in the add-in project you generated with the Yeoman generator.

Open the project in your code editor and browse over all the files listed below if you want to understand more about the components of your add-in project.

Proceed to the next section when you're ready to test your add-in.

  1. The ./manifest.xmlThe settings and capabilities of the add-in are specified by a file in the project's root directory.
  2. The ./src/taskpane/taskpane.html The HTML markup for the task pane is included in this file.
  3. The ./src/taskpane/taskpane.css The CSS for the task pane's content is contained in this file.
  4. The ./src/taskpane/taskpane.js The Office JavaScript API code in this file facilitates the communication between the task pane and the Office client application.
  5. Install the dependencies for your add-in in the project's root folder.
  6. npm install
  7. Run the following command in the root directory of your project to test our add-in in PowerPoint on a browser. When you perform this command, the local web server will start (if it’s not already working).
  8. Insert a new blank slide in PowerPoint, go to the Home tab, and then click the Show Taskpane button in the toolbar to keep bringing up the add-in task pane.

power_point_slide

[Image of PowerPoint slide]
 

power_point_slide2

[Image of PowerPoint slide]

Create the add-in project in Visual Studio

  1. In visual studio, create a New Project in Visual Studio.
  2. Using the search box, enter add-in. Select PowerPoint Web Add-in and then Next.
  3. Name your project and select create.
  4. Pick add new functions to PowerPoint in the building office add-in dialogue window, then finish to finish the project.
  5. Visual Studio generates a solution, as well as the solution's two projects, which are presented in the solution explorer.
 

Searching for Powerpoint Add-in Development Solutions?

Enquire Today.

 

Update the code

Home.html defines the HTML that will be presented in the task pane of the add-in.

Replace the

element in home.html with the following markup and save the file.
 <body class="ms-font-m ms-welcome">
&nbsp;&nbsp;&nbsp;&nbsp;<div id="content-header">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="padding">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h1>Welcome</h1>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;
<div id="content-main">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="padding">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>Select&nbsp;a&nbsp;slide&nbsp;and&nbsp;then&nbsp;choose&nbsp;the&nbsp;buttons&nbsp;to&nbsp;below&nbsp;to&nbsp;add&nbsp;content&nbsp;to&nbsp;it.</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<h3>Try&nbsp;it&nbsp;out</h3>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="ms-Button" id="insert-image">Insert&nbsp;Image</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="ms-Button" id="insert-text">Insert&nbsp;Text</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
&nbsp;&nbsp;&nbsp;&nbsp;</div></body>

 
[home.html]

Open the home.js file in the web application project's root folder.

The script for the add-in is provided in this file.

Save the file before replacing the entire contents with the code following.

  
  	&#39;use&nbsp;strict&#39;;
(function&nbsp;()&nbsp;{
&nbsp;Office.onReady(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(document).ready(function&nbsp;()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#39;#insert-image&#39;).click(insertImage);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#39;#insert-text&#39;).click(insertText);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;function&nbsp;insertImage()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office.context.document.setSelectedDataAsync(getImageAsBase64String(),&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;coercionType:&nbsp;Office.CoercionType.Image,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageLeft:&nbsp;50,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageTop:&nbsp;50,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imageWidth:&nbsp;400
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;(asyncResult)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(asyncResult.status&nbsp;===&nbsp;Office.AsyncResultStatus.Failed)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(asyncResult.error.message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;
&nbsp;function&nbsp;insertText()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office.context.document.setSelectedDataAsync(&quot;Hello&nbsp;World!&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;(asyncResult)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(asyncResult.status&nbsp;===&nbsp;Office.AsyncResultStatus.Failed)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(asyncResult.error.message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;function&nbsp;getImageAsBase64String()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&#39;iVBORw0KGgoAAAANSUhEUgAAAZAAAAEFCAIAAABCdiZrA&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;}
})();

[home.js]

Open the home.css file in the web app project's folder.

This file contains the add-custom in's styles.

Save the file after replacing the entire contents with the following code.

  #content-header {
    background: #2a8dd4;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px; 
    overflow: hidden;
}

#content-main {
    background: #fff;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto; 
}
.padding {
    padding: 15px;
}
  
[home.css]

Update the manifest

In the add-in project, open the XML manifest file. The settings and capabilities of the add-in are described in this file.

The providername element has a placeholder value. Replace it with your name.

The Displayname object's defaultvalue parameter has a placeholder. Replace it with a Ppt taskpane add-in.

 John Doe
en-US



 
[manifest.xml]

output

[output:1]

Conclusion

PowerPoint is a magnificent platform that used by thousands of businesses. Therefore, creating custom functionalities to swift operations is imperious. In this blog, we have learned how to create an add-in for PowerPoint and efficiently enhance new features.

Author Bio

Author

Author Name: Mirali Chauhan

Mirali Chauhan is an Angular freak, well focused on Web Design and Development. With demonstrated knowledge and grip over the subject, she keenly shares her insights across various platforms to help learners.