How to apply PowerPoint template (.POTX/.PPTX) to existing slides using Office.js API?

Umair Shehzad 0 Reputation points
2025-10-08T14:56:51.2733333+00:00

I am developing a PowerPoint Add-in using the Office JavaScript API.

I want to apply a PowerPoint template (POTX or PPTX) to the user’s current presentation without adding or replacing slides — basically, I want to apply the new design/theme to the existing slides.

Currently, I am using:

presentation.insertSlidesFromBase64(base64, {
  formatting: PowerPoint.InsertSlideFormatting.keepSourceFormatting
});

This inserts new slides from the uploaded template, but it doesn’t update the existing slides with the new design.


Questions

Is there any API in Office.js that can apply a POTX/PPTX theme to existing slides?

Can we copy or move content from an existing slide to a new slide programmatically?

Are there any plans to add such functionality in the PowerPoint JavaScript API?

What is the recommended approach if we want to let users change slide design dynamically?


Notes

I’m not asking about custom add-ins or commercial tools — just whether this is technically possible using Office.js or if it’s a current limitation.


Microsoft 365 and Office | Development | Office JavaScript API
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dora-T 8,265 Reputation points Microsoft External Staff Moderator
    2025-10-09T01:24:13.7833333+00:00

    Hi @Umair Shehzad

    Thank you for posting your question in the Microsoft Q&A forum.

    Based on my research, it’s not currently possible to apply a POTX or PPTX theme to existing slides using Office.js. The insertSlidesFromBase64() method can be used to add new slides, but it doesn’t modify the existing ones in the deck. 

    You can insert full slides from another presentation using insertSlidesFromBase64(), but there’s no direct way to copy or move all content between existing slides. Office.js also doesn’t currently provide an API to read all shapes from a slide and recreate them on another. 

    At the moment, there’s no public information about plans to add this functionality. As a forum moderator, I can share guidance from public Microsoft resources, but I don’t have access to internal systems or the product roadmap, so I can’t confirm if or when this might become available. You can follow the Microsoft 365 Developer Blog for any future updates.

    In the meantime, you might want to try these steps:
    1.Insert template slides and migrate content manually

    Use insertSlidesFromBase64() to insert slides from your template. Then, have users manually copy their content into the new slides or use PowerPoint’s Reuse Slides feature.

    You can refer to these articles for more details:

    Insert slides into a presentation
    Reuse (import) slides from another presentation - Microsoft Support

    2.Make the theme available in PowerPoint

    Insert at least one slide from the uploaded .potx or .pptx so the theme appears in the Design > Themes gallery.

    After that, users can manually apply the theme. You can also provide UI hints in your taskpane to guide them.

    3.Load the theme and guide users through migration

    Add a few slides from the template to bring the layouts into PowerPoint and offer a clear flow for users to move their content into the new design.

    I hope this information proves helpful and appreciate your understanding.


    If the answer is partially helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.