Hi @Umair Shehzad
Thank you for posting your question in the Microsoft Q&A forum.
Currently, the PowerPoint API in Office.js does not support applying a new theme or master layout to existing slides. There’s no access to the slide master or theme engine, so you cannot programmatically reapply or switch templates once slides are created.
Additionally, Office.js doesn’t provide a way to read all shapes from a slide and re-render them on another. This limitation has been discussed in several community threads. A few related discussions you might find helpful:
How to duplicate a slide or copy a PowerPoint shape from one slide to another using the PowerPoint …
office365 - Copy PowerPoint shapes using office js to a new slide - Stack Overflow
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
At this time, there’s no public roadmap confirming when or if the PowerPoint API will include features such as applying a theme to existing slides or cloning shapes. You can follow updates via the Microsoft 365 Developer Blog
In the meantime, here are a few workarounds you might consider:
1. Insert template slides and migrate content manually
-Insert slides from the template using insertSlidesFromBase64().
You can refer to office-js-docs-pr/docs/powerpoint/insert-slides-into-presentation.md at main · OfficeDev/office-js-…
-Prompt the user to manually copy content into the new slides or use PowerPoint’s built-in Reuse Slides feature.
2.You can still insert at least one slide from the uploaded .potx or .pptx file to ensure the theme becomes available in PowerPoint’s theme gallery. After inserting the template slides, instruct users to manually apply the theme via Design > Themes. You can support this by providing UI guidance in your taskpane.
3.Use insertSlidesFromBase64() to add a few slides from the uploaded .potx file. This brings the theme and layouts into PowerPoint. Then, provide a clear flow for users to manually copy their content into the new slides.
I hope this helps clarify the current limitations and possible approaches. Please let us know if you have further questions.
If the answer is 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.