我正在使用Office 2016 &使用JavaScript和XML清单文件的Office 365加载项。当我在网上加载清单时,一切都按预期工作。它会创建一个选项卡,并在该选项卡上放置按钮,该按钮将调用附加到清单文件中列出的html文件的JavaScript文件中的函数。Word加载项不能在功能区中创建按钮
但是,当我将此加载项加载到word 2016(对于Windows桌面)时,它不起作用。实际上,它会打开一个任务面板(侧面),而不是使用按钮创建新的选项卡。以下是列出我将用于桌面的Word加载项加载的步骤的文档(Office Dev Center - Docs - Build Your First Word Add-in,位于“适用于Windows的Word 2016试用版”部分)。请参阅下面的XML文件片段。
我遇到了与this问题完全相反的问题,并且我已经完成了this问题的答案,但它不起作用。
XML(从原来的修改):
<?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>*-*-*-*-*</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Contoso" />
<Description DefaultValue="Contoso"/>
<IconUrl DefaultValue="https://*" />
<AppDomains>
<AppDomain>AppDomain1</AppDomain>
<AppDomain>AppDomain2</AppDomain>
<AppDomain>AppDomain3</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Document" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://*" />
</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">
<CustomTab id="contoso.Tab">
<Group id="contoso.Events">
<Label resid="contoso.EventsLabel" />
<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.EventButton">
<Label resid="contoso.EventButton.Label" />
<Supertip>
<Title resid="contoso.EventButton.Label" />
<Description resid="contoso.EventButton.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="ExecuteFunction">
<FunctionName>openEventWindow</FunctionName>
</Action>
</Control>
</Group>
<Label resid="contoso.Tab.Label" />
</CustomTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="contoso.tpicon_16x16" DefaultValue="https://*" />
<bt:Image id="contoso.tpicon_32x32" DefaultValue="https://*" />
<bt:Image id="contoso.tpicon_80x80" DefaultValue="https://*" />
</bt:Images>
<bt:Urls>
<bt:Url id="contoso.DesktopFunctionFile.Url" DefaultValue="https://*" />
<bt:Url id="contoso.GetStarted.LearnMoreUrl" DefaultValue="https://*" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="contoso.Tab.Label" DefaultValue="Contoso" />
<bt:String id="contoso.EventButton.Label" DefaultValue="Add to Event" />
<bt:String id="contoso.EventsLabel" DefaultValue="Events" />
<bt:String id="contoso.GetStarted.Title" DefaultValue="Get started with Contoso!" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="contoso.EventButton.Tooltip" DefaultValue="Click to browse the active events" />
<bt:String id="contoso.GetStarted.Description" DefaultValue="The contoso Add In has loaded successfully!" />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
注:此插件的作品,因为我希望在Word中365,而不是在Word 2016人有什么想法?是否有一个选项需要在安装Office 2016时进行更改,这可能会阻止它们正确加载?
我的办公室版本是16.0.6741.2048。我有一个Office 365 ProPlus订阅。 –
@RyanAndrews:如果您升级Office安装,任何成功? –
@RyanAndrews:[Office加载项命令示例](https://github.com/OfficeDev/Office-Add-in-Commands-Samples)的文档声明所需的最低版本为16.0.6769.0000或更高(建议使用16.0.6868.0000)。 –