Office.OfficeTheme interface

Bietet Zugriff auf die Eigenschaften für Office-Farbdesigns.

Mithilfe von Office-Designfarben können Sie das Farbschema Ihres Add-Ins mit dem aktuellen Office-Design koordinieren, das vom Benutzer mit derOffice-Design-Benutzeroberfläche "Datei>Office-Konto>" ausgewählt wurde, die auf alle Office-Anwendungen angewendet wird. Using Office theme colors is appropriate for mail and task pane add-ins.

Hinweise

Unterstützte Anwendungen nach Plattform

Office unter Windows Office im Web Office für Mac Office unter iOS Office unter Android
Excel Unterstützt Nicht verfügbar Unterstützt Unterstützt Nicht verfügbar
Outlook Vorschau Nicht verfügbar Nicht verfügbar Nicht verfügbar Nicht verfügbar
PowerPoint Unterstützt Nicht verfügbar Unterstützt Unterstützt Nicht verfügbar
Word Unterstützt Unterstützt Unterstützt Unterstützt Nicht verfügbar

Beispiele

function applyOfficeTheme(){
    // Get office theme colors.
    const bodyBackgroundColor = Office.context.officeTheme.bodyBackgroundColor;
    const bodyForegroundColor = Office.context.officeTheme.bodyForegroundColor;
    const controlBackgroundColor = Office.context.officeTheme.controlBackgroundColor;
    const controlForegroundColor = Office.context.officeTheme.controlForegroundColor;

    // Apply body background color to a CSS class.
    $('.body').css('background-color', bodyBackgroundColor);
}

Eigenschaften

bodyBackgroundColor

Ruft die Hintergrundfarbe des Office-Designtexts als hexadezimales Farbdreieck ab (z. B. "#FFA500").

bodyForegroundColor

Ruft die Vordergrundfarbe des Office-Designkörpers als hexadezimales Farbdreieck ab (z. B. "#FFA500").

controlBackgroundColor

Ruft die Hintergrundfarbe des Office-Designsteuerelements als hexadezimales Farbdreieck ab (z. B. "#FFA500").

controlForegroundColor

Ruft die Vordergrundfarbe des Office-Designsteuerelements als hexadezimales Farbdreieck ab (z. B. "#FFA500").

Details zur Eigenschaft

bodyBackgroundColor

Ruft die Hintergrundfarbe des Office-Designtexts als hexadezimales Farbdreieck ab (z. B. "#FFA500").

bodyBackgroundColor: string;

Eigenschaftswert

string

bodyForegroundColor

Ruft die Vordergrundfarbe des Office-Designkörpers als hexadezimales Farbdreieck ab (z. B. "#FFA500").

bodyForegroundColor: string;

Eigenschaftswert

string

controlBackgroundColor

Ruft die Hintergrundfarbe des Office-Designsteuerelements als hexadezimales Farbdreieck ab (z. B. "#FFA500").

controlBackgroundColor: string;

Eigenschaftswert

string

controlForegroundColor

Ruft die Vordergrundfarbe des Office-Designsteuerelements als hexadezimales Farbdreieck ab (z. B. "#FFA500").

controlForegroundColor: string;

Eigenschaftswert

string