JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
1,054 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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();
shapes.load("items");
await context.sync();
shapes.items[0].fill.setSolidColor("red");
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.