Share via

"Office.context.officeTheme" Javascript API gives empty object while i using to get outlook theme for my Add-in in mac desktop app

Rajesh V 0 Reputation points
2024-08-01T06:56:36.14+00:00

I'm developing an Office add-in for Outlook and need to dynamically adjust the add-in's appearance based on the currently selected theme in Outlook. The Office.context.officeTheme object provides the necessary theme color information on most platforms, but it returns an empty object when used in Outlook on Mac desktop. But the thing is this API is working for windows web,desktop App and Mac web also its working.

Office.onReady(info => { if (info.host === Office.HostType.Outlook) { console.log(Office.context.officeTheme); // Outputs an empty object on Mac desktop Outlook } });

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
0 comments No comments

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.