次の方法で共有


Override 要素

指定した条件に応じてマニフェスト設定の値をオーバーライドする方法を提供します。 条件には次の 3 種類があります。

  • LocaleTokenOverride と呼ばれる既定のLocaleTokenとは異なる Office ロケール。
  • RequirementTokenOverride と呼ばれる既定のRequirementToken パターンとは異なる要件セットサポートのパターン。
  • ソースは、RuntimeOverride と呼ばれる既定のRuntimeとは異なります。

< Runtime> 要素内にある <Override> 要素は、RuntimeOverride 型である必要があります。

<Override> 要素のoverrideType属性はありません。 違いは、親要素と親要素の型によって決まります。 xsi:typeRequirementTokenされている<Token>要素の内部にある<Override> 要素は、RequirementTokenOverride 型である必要があります。 <Override>他の親要素内の要素、またはLocaleToken型の<Override>要素内の要素は、LocaleTokenOverride 型である必要があります。

各型については、この記事の後半の個別のセクションで説明します。

のオーバーライド要素 LocaleToken

<Override> 要素は条件付きを表し、"If .." と読み取ることができます。次に ...."陳述。 <Override> 要素が LocaleTokenOverride 型の場合、Locale属性が条件であり、Value属性が結果になります。 たとえば、次の例は"Office ロケール設定が fr-fr の場合、表示名は 'Lecteur vidéo' です。

<DisplayName DefaultValue="Video player">
    <Override Locale="fr-fr" Value="Lecteur vidéo" />
</DisplayName>

アドインの種類: コンテンツ、作業ウィンドウ、メール

構文

<Override Locale="string" Value="string"></Override>

含まれる場所

要素
CitationText
説明
DictionaryName
DictionaryHomePage
DisplayName
HighResolutionIconUrl
IconUrl
Image
QueryUri
SourceLocation
String
SupportUrl
トークン
Url

属性

属性 種類 必須 説明
Locale string はい このオーバーライドのロケールのカルチャ名を BCP 47 言語タグ形式 ( "en-US"など) で指定します。
string はい 指定のロケールに対して表される設定の値を指定します。

<DisplayName DefaultValue="Video player">
    <Override Locale="fr-fr" Value="Lecteur vidéo" />
</DisplayName>
<bt:Image id="icon1_16x16" DefaultValue="https://www.contoso.com/icon_default.png">
    <bt:Override Locale="ja-jp" Value="https://www.contoso.com/ja-jp16-icon_default.png" />
</bt:Image>
  <ExtendedOverrides Url="http://contoso.com/addinmetadata/${token.locale}/extended-manifest-overrides.json">
    <Tokens>
      <Token Name="locale" DefaultValue="en-us" xsi:type="LocaleToken">
        <Override Locale="es-*" Value="es-es" />
        <Override Locale="es-mx" Value="es-mx" />
        <Override Locale="fr-*" Value="fr-fr" />
        <Override Locale="ja-jp" Value="ja-jp" />
      </Token>
    <Tokens>
  </ExtendedOverrides>

関連項目

のオーバーライド要素 RequirementToken

<Override> 要素は条件付きを表し、"If .." と読み取ることができます。次に ...."陳述。 <Override> 要素が RequirementTokenOverride 型の場合、子<Requirements> 要素は条件を表し、Value属性が結果になります。 たとえば、次の最初の<Override>は、「現在のプラットフォームで FeatureOne バージョン 1.7 がサポートされている場合は、祖父母の <ExtendedOverrides> (既定の文字列 'upgrade' ではなく) の URL の${token.requirements} トークンの代わりに文字列 'oldAddinVersion' を使用します。"

<ExtendedOverrides Url="http://contoso.com/addinmetadata/${token.requirements}/extended-manifest-overrides.json">
    <Tokens>
        <Token Name="requirements" DefaultValue="upgrade" xsi:type="RequirementsToken">
            <Override Value="oldAddinVersion">
                <Requirements>
                    <Sets>
                        <Set Name="FeatureOne" MinVersion="1.7" />
                    </Sets>
                </Requirements>
            </Override>
            <Override Value="currentAddinVersion">
                <Requirements>
                    <Sets>
                        <Set Name="FeatureOne" MinVersion="1.8" />
                    </Sets>
                    <Methods>
                        <Method Name="MethodThree" />
                    </Methods>
                </Requirements>
            </Override>
        </Token>
    </Tokens>
</ExtendedOverrides>

アドインの種類: 作業ウィンドウ

構文

<Override Value="string" />

含まれる場所

要素
トークン

含める必要があるもの

RequirementToken の <Override> 要素には、アドインの種類に応じて次の子要素が含まれている必要があります。

要素 コンテンツ メール TaskPane
Requirements いいえ いいえ はい

属性

属性 種類 必須 説明
string はい 条件が満たされたときの祖父母トークンの値。

<ExtendedOverrides Url="http://contoso.com/addinmetadata/${token.requirements}/extended-manifest-overrides.json">
    <Token Name="requirements" DefaultValue="upgrade" xsi:type="RequirementsToken">
        <Override Value="very-old">
            <Requirements>
                <Sets>
                    <Set Name="FeatureOne" MinVersion="1.5" />
                    <Set Name="FeatureTwo" MinVersion="1.1" />
                </Sets>
            </Requirements>
        </Override>
        <Override Value="old">
            <Requirements>
                <Sets>
                    <Set Name="FeatureOne" MinVersion="1.7" />
                    <Set Name="FeatureTwo" MinVersion="1.2" />
                </Sets>
            </Requirements>
        </Override>
        <Override Value="current">
            <Requirements>
                <Sets>
                    <Set Name="FeatureOne" MinVersion="1.8" />
                    <Set Name="FeatureTwo" MinVersion="1.3" />
                </Sets>
                <Methods>
                    <Method Name="MethodThree" />
                </Methods>
            </Requirements>
        </Override>
    </Token>
</ExtendedOverrides>

関連項目

のオーバーライド要素 Runtime

重要

この要素のサポートは、イベント ベースのアクティブ化機能を持つメールボックス要件セット 1.10 で導入されました。 この要件セットをサポートする クライアントおよびプラットフォーム を参照してください。

<Override> 要素は条件付きを表し、"If .." と読み取ることができます。次に ...."陳述。 <Override> 要素が RuntimeOverride 型の場合、type属性が条件であり、resid属性が結果になります。 たとえば、"型が 'javascript' の場合、 resid は 'JSRuntime.Url' と読み取られます。Windows 上の Outlook では、 LaunchEvent 拡張ポイントReportPhishingCommandSurface 拡張ポイント (プレビュー) ハンドラーにこの要素が必要です。

<Runtime resid="WebViewRuntime.Url">
  <Override type="javascript" resid="JSRuntime.Url"/>
</Runtime>

アドインの種類: メール

構文

<Override type="javascript" resid="JSRuntime.Url"/>

含まれる場所

属性

属性 種類 必須 説明
type string はい このオーバーライドの言語を指定します。 現時点では、 "javascript" のみがサポートされているオプションです。
resid string はい Runtime 要素の residで定義されている既定の HTML の URL の場所をオーバーライドする JavaScript ファイルの URL の場所を指定します。 residは 32 文字以内であり、Resources 要素のUrl要素のid属性と一致する必要があります。

<!-- Event-based activation and integrated spam reporting happen in a lightweight runtime.-->
<Runtimes>
  <!-- HTML file including reference to or inline JavaScript event handlers.
  This is used by Outlook on the web, on the new Mac UI, and new Outlook on Windows. -->
  <Runtime resid="WebViewRuntime.Url">
    <!-- JavaScript file containing event handlers. This is used by Outlook on Windows. -->
    <Override type="javascript" resid="JSRuntime.Url"/>
  </Runtime>
</Runtimes>

関連項目