「[Officeアドイン]マニフェストファイルをデバッグする方法」でマニフェストファイルを読み込んだ時のログを取る方法を紹介しましたが、今回は「Microsoft Office Add-in Manifest Validator」を使ってマニフェストファイルを検証する方法を紹介します。
Office Add-in Manifest Validatorのインストール
「YO OFFICE」と同様、npmを使ってパッケージをインストールします。
npm install -g office-addin-validator

npmのインストール方法については下記記事をご参照ください。
Office Add-in Manifest Validatorの使い方
使い方は簡単で、「validate-office-addin」にマニフェストファイルを指定するだけです。
validate-office-addin my-office-add-in-manifest.xml
YO OFFICEで作成したマニフェストを検証にかけたらさっそく怒られました…。
SupportUrl要素がコメントアウトされていたのがマズかったようです。

修正&検証を繰り返した結果、無事に「Validation: Passed」になりました。
Validation: Passed Based on the requirements specified in your manifest, your add-in can run on the following platforms; your add-in will be tested on these platforms when you submit it to the Office Store: - Word 2013 Service Pack 1 or later - Word 2016 or later - Word Online - Word 2016 for Mac Important: This analysis is based on the requirements specified in your manifest and does not account for any runtime JavaScript calls within your add-in. For information about which API sets and features are supported on each platform, see Office Add-in host and platform availability. (https://dev.office.com/add-in-availability). *This does not include mobile apps. You can opt-in to support mobile apps when you submit your add-in.
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>9d09eb08-8488-4352-9a7c-06bea23cf2a2</Id>
<Version>1.0.0.0</Version>
<ProviderName>@kinuasa</ProviderName>
<DefaultLocale>ja-JP</DefaultLocale>
<DisplayName DefaultValue="My Office Add-in" />
<Description DefaultValue="My Office Add-i description." />
<IconUrl DefaultValue="https://localhost/assets/icon-32.png" />
<!--<HighResolutionIconUrl DefaultValue="https://localhost/assets/hi-res-icon.png" />-->
<SupportUrl DefaultValue="https://localhost/support.html" />
<AppDomains>
<AppDomain>AppDomain1</AppDomain>
<AppDomain>AppDomain2</AppDomain>
<AppDomain>AppDomain3</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Document" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost/index.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Document">
<DesktopFormFactor>
<GetStarted>
<Title resid="Contoso.GetStarted.Title" />
<Description resid="Contoso.GetStarted.Description" />
<LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl" />
</GetStarted>
<FunctionFile resid="Contoso.DesktopFunctionFile.Url" />
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<OfficeTab id="TabHome">
<Group id="Contoso.Group1">
<Label resid="Contoso.Group1Label" />
<Icon>
<bt:Image size="16" resid="Contoso.tpicon_16x16" />
<bt:Image size="32" resid="Contoso.tpicon_32x32" />
<bt:Image size="80" resid="Contoso.tpicon_80x80" />
</Icon>
<Control xsi:type="Button" id="Contoso.TaskpaneButton">
<Label resid="Contoso.TaskpaneButton.Label" />
<Supertip>
<Title resid="Contoso.TaskpaneButton.Label" />
<Description resid="Contoso.TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Contoso.tpicon_16x16" />
<bt:Image size="32" resid="Contoso.tpicon_32x32" />
<bt:Image size="80" resid="Contoso.tpicon_80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Contoso.Taskpane.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Contoso.tpicon_16x16" DefaultValue="https://localhost/assets/icon-16.png" />
<bt:Image id="Contoso.tpicon_32x32" DefaultValue="https://localhost/assets/icon-32.png" />
<bt:Image id="Contoso.tpicon_80x80" DefaultValue="https://localhost/assets/icon-80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Contoso.Taskpane.Url" DefaultValue="https://localhost/index.html" />
<bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
<bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="https://localhost/function-file/function-file.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
<bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
<bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
<bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
Office ストアに提出する前に自分でマニフェストファイルを検証するのにとても役立つツールです。
少々判定が厳しいように思いますが、Office アドイン開発者にはお薦めのツールですので、興味がある方は是非お使いください!





















この記事へのコメントはありません。