Office.OfficeThemeChangedEventArgs interface

Provides the updated Office theme that raised the Office.EventType.OfficeThemeChanged event.

Remarks

[ API set: Mailbox 1.14 ]

Examples

// Adds an event handler for the OfficeThemeChanged event.
Office.onReady(() => {
    document.addEventListener('DOMContentLoaded', () => {
        // Get a reference to the mailbox and use it to add an event handler.
        const mailbox = Office.context.mailbox;
        mailbox.addHandlerAsync(Office.EventType.OfficeThemeChanged, officeThemeChangedHandler, (result) => {
            if (result.status === Office.AsyncResultStatus.Failed) {
                console.error(`Failed to add event handler: ${asyncResult.error.message}`);
                return;
            }

            console.log("Event handler added successfully.");
        });
    });
});

// Handles the OfficeThemeChanged event.
function officeThemeChangedHandler(event) {
    console.log(`Event: ${event.type}`);
    const currentTheme = event.officeTheme;
    // Perform operations based on the current theme.
}

Properties

officeTheme

Gets the updated Office theme.

type

Gets the type of the event. For details, refer to Office.EventType.

Property Details

officeTheme

Gets the updated Office theme.

officeTheme: Office.OfficeTheme;

Property Value

Remarks

[ API set: Mailbox 1.14 ]

type

Gets the type of the event. For details, refer to Office.EventType.

type: "officeThemeChanged";

Property Value

"officeThemeChanged"

Remarks

[ API set: Mailbox 1.14 ]