Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/powerpoint/insert-slides-into-presentation.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Insert slides in a PowerPoint presentation
title: Insert slides from another PowerPoint presentation
description: Learn how to insert slides from one presentation into another.
ms.date: 03/07/2021
ms.date: 11/07/2025
ms.localizationpriority: medium
---

# Insert slides in a PowerPoint presentation
# Insert slides from another PowerPoint presentation

A PowerPoint add-in can insert slides from one presentation into the current presentation by using PowerPoint's application-specific JavaScript library. You can control whether the inserted slides keep the formatting of the source presentation or the formatting of the target presentation.

Expand Down Expand Up @@ -38,13 +38,13 @@ There are many ways to convert a file to Base64. Which programming language and
> [!NOTE]
> There are many other ways to get a PowerPoint file. For example, if the file is stored on OneDrive or SharePoint, you can use Microsoft Graph to download it. For more information, see [Working with files in Microsoft Graph](/graph/api/resources/onedrive) and [Access Files with Microsoft Graph](/training/modules/msgraph-access-file-data/).

2. Add the following code to the add-in's JavaScript to assign a function to the input control's `change` event. (You create the `storeFileAsBase64` function in the next step.)
1. Add the following code to the add-in's JavaScript to assign a function to the input control's `change` event. (You create the `storeFileAsBase64` function in the next step.)

```javascript
$("#file").on("change", storeFileAsBase64);
```

3. Add the following code. Note the following about this code.
1. Add the following code. Note the following about this code.

- The `reader.readAsDataURL` method converts the file to Base64 and stores it in the `reader.result` property. When the method completes, it triggers the `onload` event handler.
- The `onload` event handler trims metadata off of the encoded file and stores the encoded string in a global variable.
Expand Down Expand Up @@ -165,6 +165,6 @@ async function insertAfterSelectedSlide() {
> [!NOTE]
> The slides will be inserted in the same relative order in which they appear in the source presentation, regardless of the order in which they appear in the array.

There is no practical way that users can discover the ID or creation ID of a slide in the source presentation. For this reason, you can really only use the `sourceSlideIds` property when either you know the source IDs at coding time or your add-in can retrieve them at runtime from some data source. Because users cannot be expected to memorize slide IDs, you also need a way to enable the user to select slides, perhaps by title or by an image, and then correlate each title or image with the slide's ID.
There's no practical way that users can discover the ID or creation ID of a slide in the source presentation. For this reason, you can really only use the `sourceSlideIds` property when either you know the source IDs at coding time or your add-in can retrieve them at runtime from some data source. Because users cannot be expected to memorize slide IDs, you also need a way to enable the user to select slides, perhaps by title or by an image, and then correlate each title or image with the slide's ID.

Accordingly, the `sourceSlideIds` property is primarily used in presentation template scenarios: The add-in is designed to work with a specific set of presentations that serve as pools of slides that can be inserted. In such a scenario, either you or the customer must create and maintain a data source that correlates a selection criterion (such as titles or images) with slide IDs or slide creation IDs that has been constructed from the set of possible source presentations.
28 changes: 14 additions & 14 deletions docs/powerpoint/use-document-themes-in-your-powerpoint-add-ins.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
title: Use document themes in your PowerPoint add-ins
title: Use Office document themes in your PowerPoint add-ins
description: Learn how to visually coordinate themes, such as fonts and colors, to apply to PowerPoint presentations.
ms.date: 06/18/2024
ms.date: 11/07/2025
ms.localizationpriority: medium
---

# Use document themes in your PowerPoint add-ins
# Use Office document themes in your PowerPoint add-ins

An [Office theme](https://support.microsoft.com/office/83e68627-2c17-454a-9fd8-62deb81951a6) consists, in part, of a visually coordinated set of fonts and colors that you can apply to presentations, documents, worksheets, and emails. To apply or customize the theme of a presentation in PowerPoint, you use the **Themes** and **Variants** groups on **Design** tab of the ribbon. PowerPoint assigns a new blank presentation with the default **Office Theme**, but you can choose other themes available on the **Design** tab, download additional themes from Office.com, or create and customize your own theme.

Using **OfficeThemes.css**, design add-ins that are coordinated with PowerPoint in two ways.

- **In content add-ins for PowerPoint**. Use the document theme classes of **OfficeThemes.css** to specify fonts and colors that match the theme of the presentation your content add-in is inserted into - and those fonts and colors will dynamically update if a user changes or customizes the presentation's theme.
- **In content add-ins for PowerPoint**. Use the document theme classes of **OfficeThemes.css** to specify fonts and colors that match the theme of the presentation your content add-in is inserted into. Those fonts and colors will dynamically update if a user changes or customizes the presentation's theme.

- **In task pane add-ins for PowerPoint**. Use the Office UI theme classes of **OfficeThemes.css** to specify the same fonts and background colors used in the UI so that your task pane add-ins will match the colors of built-in task panes - and those colors will dynamically update if a user changes the Office UI theme.
- **In task pane add-ins for PowerPoint**. Use the Office UI theme classes of **OfficeThemes.css** to specify the same fonts and background colors used in the UI so that your task pane add-ins will match the colors of built-in task panes. Those colors will dynamically update if a user changes the Office UI theme.

## Document theme colors

Every Office document theme defines 12 colors. Ten of these colors are available when you set font, background, and other color settings in a presentation with the color picker.

![Color palette.](../images/office15-app-color-palette.png)

To view or customize the full set of 12 theme colors in PowerPoint, in the **Variants** group on the **Design** tab, click the **More** drop-down - then select **Colors** > **Customize Colors** to display the **Create New Theme Colors** dialog box.
To view or customize the full set of 12 theme colors in PowerPoint, in the **Variants** group on the **Design** tab, click the **More** dropdown list then select **Colors** > **Customize Colors** to display the **Create New Theme Colors** dialog box.

![Create new theme colors dialog box.](../images/office15-app-create-new-theme-colors.png)

Expand All @@ -33,15 +33,15 @@ Every Office document theme also defines two fonts -- one for headings and one f

![The font picker.](../images/office15-app-font-picker.png)

To view or customize theme fonts in PowerPoint, in the **Variants** group on the **Design** tab, click the **More** drop-down - then select **Fonts** > **Customize Fonts** to display the **Create New Theme Fonts** dialog box.
To view or customize theme fonts in PowerPoint, in the **Variants** group on the **Design** tab, click the **More** dropdown list then select **Fonts** > **Customize Fonts** to display the **Create New Theme Fonts** dialog box.

![Create new theme fonts dialog box.](../images/office15-app-create-new-theme-fonts.png)

### Office UI theme fonts and colors

Office also lets you choose between several predefined themes that specify some of the colors and fonts used in the UI of all Office applications. To do that, you use the **File** > **Account** > **Office Theme** drop-down (from any Office application).
Office also lets you choose between several predefined themes that specify some of the colors and fonts used in the UI of all Office applications. To do that, you use the **File** > **Account** > **Office Theme** dropdown list (from any Office application).

![Office theme drop-down.](../images/office15-app-office-theme-picker.png)
![Office theme dropdown list.](../images/office15-app-office-theme-picker.png)

**OfficeThemes.css** includes classes that you can use in your task pane add-ins for PowerPoint so they will use these same fonts and colors. This lets you design your task pane add-ins that match the appearance of built-in task panes.

Expand All @@ -54,7 +54,7 @@ Using the **OfficeThemes.css** file with your content add-ins for PowerPoint let
Use the following steps to add and reference the **OfficeThemes.css** file to your add-in project.

> [!NOTE]
> The steps in this procedure only apply to Visual Studio 2015. If you are using Visual Studio 2019, the **OfficeThemes.css** file is created automatically for any new PowerPoint add-in projects that you create.
> The steps in this procedure only apply to Visual Studio 2015. If you're using Visual Studio 2019, the **OfficeThemes.css** file is created automatically for any new PowerPoint add-in projects that you create.

1. In **Solution Explorer**, right-click (or select and hold) the **Content** folder in the _**project_name**_**Web** project, choose **Add**, and then select **Style Sheet**.

Expand Down Expand Up @@ -123,7 +123,7 @@ Use the following steps to add and reference the **OfficeThemes.css** file to yo
.office-officeTheme-secondary-bgColor { background-color:#ffffff; }
```

1. If you are using a tool other than Visual Studio to create your add-in, copy the CSS code from the previous step into a text file. Then, save the file as **OfficeThemes.css**.
1. If you're using a tool other than Visual Studio to create your add-in, copy the CSS code from the previous step into a text file. Then, save the file as **OfficeThemes.css**.

## Reference OfficeThemes.css in your add-in's HTML pages

Expand All @@ -133,7 +133,7 @@ To use the **OfficeThemes.css** file in your add-in project, add a `<link>` tag
<link href="<local_path_to_OfficeThemes.css>" rel="stylesheet" type="text/css" />
```

To do this in Visual Studio, follow these steps.
To do this in Visual Studio, follow these steps:

1. Choose **Create a new project**.

Expand All @@ -151,7 +151,7 @@ To do this in Visual Studio, follow these steps.
<link href="../../Content/OfficeThemes.css" rel="stylesheet" type="text/css" />
```

If you are creating your add-in with a tool other than Visual Studio, add a `<link>` tag with the same format specifying a relative path to the copy of **OfficeThemes.css** that will be deployed with your add-in.
If you're creating your add-in with a tool other than Visual Studio, add a `<link>` tag with the same format specifying a relative path to the copy of **OfficeThemes.css** that will be deployed with your add-in.

### Use OfficeThemes.css document theme classes in your content add-in's HTML page

Expand Down Expand Up @@ -182,7 +182,7 @@ If you change the presentation to use another theme or customize the presentatio

### Use OfficeThemes.css Office UI theme classes in your task pane add-in's HTML page

In addition to the document theme, users can customize the color scheme of the Office user interface for all Office applications using the **File** > **Account** > **Office Theme** drop-down box.
In addition to the document theme, users can customize the color scheme of the Office user interface for all Office applications using the **File** > **Account** > **Office Theme** dropdown box.

The following shows a simple example of HTML in a task pane add-in that uses OfficeTheme.css classes to specify font color and background color. For details about the **OfficeThemes.css** classes that correspond to fonts and colors of the Office UI theme, see [Theme classes for task pane add-ins](#theme-classes-for-task-pane-add-ins).

Expand Down
4 changes: 2 additions & 2 deletions docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@
- name: Add and delete slides
href: powerpoint/add-slides.md
displayName: PowerPoint
- name: Insert slides
- name: Insert slides from another presentation
href: powerpoint/insert-slides-into-presentation.md
displayName: PowerPoint
- name: Get the whole document from an add-in
Expand All @@ -970,7 +970,7 @@
- name: Use custom tags on presentations, slides, and shapes
href: powerpoint/tagging-presentations-slides-shapes.md
displayName: PowerPoint
- name: Use document themes in your PowerPoint add-ins
- name: Use Office document themes
href: powerpoint/use-document-themes-in-your-powerpoint-add-ins.md
displayName: PowerPoint
- name: Work with shapes
Expand Down