Office.OfficeTheme interface
Office テーマの色のプロパティにアクセスできるようにします。
Office テーマの色を使用すると、すべての Office アプリケーションに適用されるファイル>Office アカウント> Officeテーマ UI を使用して、ユーザーが選択した現在の Office テーマとアドインの配色を調整できます。 Using Office theme colors is appropriate for mail and task pane add-ins.
注釈
サポートされているアプリケーション (プラットフォーム別)
Office on the web | Office on Windows | Office on Mac | iOS 上の Office | Android 上の Office | |
---|---|---|---|---|---|
Excel | 使用不可 | サポート | サポート | サポート | 利用不可 |
Outlook | 使用不可 | Preview | 使用不可 | 使用不可 | 使用不可 |
PowerPoint | 使用不可 | サポート | サポートされている | サポート | 利用不可 |
Word | サポート | サポート | サポート | サポート | 利用不可 |
例
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);
}
プロパティ
body |
Office テーマ本体の背景色を 16 進色のトリプレット ("#FFA500" など) として取得します。 |
body |
Office テーマ本体の前景色を 16 進色のトリプレット ("#FFA500" など) として取得します。 |
control |
Office テーマ コントロールの背景色を 16 進色のトリプレット ("#FFA500" など) として取得します。 |
control |
Office テーマ コントロールの前景色を 16 進色のトリプレット ("#FFA500" など) として取得します。 |
プロパティの詳細
bodyBackgroundColor
Office テーマ本体の背景色を 16 進色のトリプレット ("#FFA500" など) として取得します。
bodyBackgroundColor: string;
プロパティ値
string
bodyForegroundColor
Office テーマ本体の前景色を 16 進色のトリプレット ("#FFA500" など) として取得します。
bodyForegroundColor: string;
プロパティ値
string
controlBackgroundColor
Office テーマ コントロールの背景色を 16 進色のトリプレット ("#FFA500" など) として取得します。
controlBackgroundColor: string;
プロパティ値
string
controlForegroundColor
Office テーマ コントロールの前景色を 16 進色のトリプレット ("#FFA500" など) として取得します。
controlForegroundColor: string;
プロパティ値
string
Office Add-ins
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示