-
Notifications
You must be signed in to change notification settings - Fork 120
Accessing themeColorScheme leads to error in PowerPoint Online #6582
Copy link
Copy link
Open
Labels
Area: PowerPointIssue related to PowerPoint add-insIssue related to PowerPoint add-insNeeds: attention 👋Waiting on Microsoft to provide feedbackWaiting on Microsoft to provide feedbackPlatform: OnlineIssues occurred on online platformIssues occurred on online platformType: product bugBug in the Office Add-ins platform or Office JavaScript APIsBug in the Office Add-ins platform or Office JavaScript APIs
Description
Your Environment
- Platform [PC desktop, Mac, iOS, Office on the web]: Office on the web
- Host [Excel, Word, PowerPoint, etc.]: PowerPoint
- Office version number: latest
- Operating System: browser-based (Windows)
- Browser (if using Office on the web): Edge, Firefox
Expected behavior
I expect the following code to print the color code of the Accent 1 color, e.g., Accent1: #156082.
PowerPoint.run(async context => {
if (Office.context.requirements.isSetSupported("PowerPointApi", "1.10")) {
const masters = context.presentation.slideMasters;
masters.load("items");
await context.sync();
const scheme = masters.items[0].themeColorScheme;
await context.sync(); // <-- Error occurs here (or in second context.sync if commented out)
const color = scheme.getThemeColor("Accent1");
await context.sync();
console.log(`Accent1: ${color.value}`);
}
});Current behavior
The code works as expected on PowerPoint on Windows.
In PowerPoint Online the context.sync() fails with: Uncaught (in promise) RichApi.Error: GeneralException
Steps to reproduce
- Open Script Lab add-in > New
- Paste code above and run
- See output in add-in on Windows and error in browser console in PowerPoint Online
Link to live example(s)
n/a
Context
I want to determine if a textbox shape uses a theme color for the font. PowerPoint.ShapeFont.color only returns a hex color code, so I need to compare it with the theme colors.
Useful logs
n/a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: PowerPointIssue related to PowerPoint add-insIssue related to PowerPoint add-insNeeds: attention 👋Waiting on Microsoft to provide feedbackWaiting on Microsoft to provide feedbackPlatform: OnlineIssues occurred on online platformIssues occurred on online platformType: product bugBug in the Office Add-ins platform or Office JavaScript APIsBug in the Office Add-ins platform or Office JavaScript APIs