How to freeze the color of selected shape so that changing theme color should not affect the shape color in power point using Office JS API

Amira Muzaffar 0 Reputation points

I am trying to freeze the color of the shape which user has selected, so once the shape color is set frozen the theme color should not apply on it. To set the color of the shape I am using the below code. but I could not find anything regarding freeing the shape color with Office JS. Is there any method available to freeze the color. Even if the user change the theme, the color of the shape should not get changed.

const shapes = context.presentation.getSelectedShapes();
const shapeCount = shapes.getCount();
await context.sync();
await context.sync();

I tries setting the color manually and its working but I need to freeze the color so that I cannot changed with different theme set up for the slide.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
864 questions
0 comments No comments
{count} votes