2017-07-03 73 views
0

我爲Office加載項創建了一個樣本清單文件。但是在XML模式中有一些問題。如果我正在使用VersionOverrides自身的內容進行評論,則加載項可以正常工作。無法加載Office加載項

如果有人能說出這個問題。

注意:源位置和功能文件在我的工作區中可用。

附加清單代碼。

感謝 作者Abhijit

<?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>cea85fda-84f6-4278-8d81-74126a2c3870</Id> 
     <Version>1.0.0.0</Version> 
     <ProviderName>Microsoft</ProviderName> 
     <DefaultLocale>en-US</DefaultLocale> 
     <DisplayName DefaultValue="demo Add" /> 
     <Description DefaultValue="demo hello"/> 
     <Capabilities> 
     <Capability Name="Workbook" /> 
     </Capabilities> 
     <AppDomains> 
    <AppDomain>http://localhost:8080</AppDomain> 
    <AppDomain>AppDomain2</AppDomain> 
    <AppDomain>AppDomain3</AppDomain> 
    </AppDomains> 
    <!--EndBasicSettings--> 
    <!--BeginTaskpaneMode integration. Office 2013 and any client that doesn't understand commands will use this section. 
    This section will also be used if there are no VersionOverrides --> 
    <Hosts> 
    <Host Name="Workbook" /> 
    </Hosts> 
    <Requirements> 
    <Sets DefaultMinVersion="1.1"> 
     <Set Name="TableBindings" /> 
    </Sets> 
    </Requirements> 
     <DefaultSettings> 
     <SourceLocation DefaultValue="http://localhost:8080/excelDemo/Home.html" /> 
     </DefaultSettings> 
     <Permissions>ReadWriteDocument</Permissions> 
     <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> 
     <Hosts> 
      <Host xsi:type="Workbook"> 
       <DesktopFormFactor> 
      <!--Function file is an html page that includes the javascript where functions for ExecuteAction will be called. 
      Think of the FunctionFile as the "code behind" ExecuteFunction --> 
      <FunctionFile resid="residDesktopCommnadUrl" /> 
      <!--PrimaryCommandSurface==Main Office Ribbon--> 
      <ExtensionPoint xsi:type="PrimaryCommandSurface"> 
      <!--Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab --> 
      <!-- Documentation includes all the IDs currently tested to work --> 
      <CustomTab id="SmartViewAddIns"> 
       <!--Group. Ensure you provide a unique id. Recommendation for any IDs is to namespace using your companyname--> 

       <Label resid="residLabel5" /> 
      </CustomTab> 

      </ExtensionPoint> 
     </DesktopFormFactor> 
      </Host> 
     </Hosts> 
     <Resources> 
      <bt:Images> 
       <bt:Image id="icon_login_16" DefaultValue="https://gsmadatahub-dev.corp.apple.com/opf-mac/display/icons/login.png"></bt:Image> 
       <bt:Image id="icon_login_32" DefaultValue="https://gsmadatahub-dev.corp.apple.com/opf-mac/display/icons/login.png"></bt:Image> 
       <bt:Image id="icon_login_80" DefaultValue="https://gsmadatahub-dev.corp.apple.com/opf-mac/display/icons/login.png"></bt:Image> 
      </bt:Images> 
      <bt:Urls> 
       <bt:Url id="Contoso.FunctionFile.Url" DefaultValue="http://localhost:8080/excelDemo/commands.html" /> 
      </bt:Urls> 
      <bt:ShortStrings> 
       <bt:String id="Contoso.Tab1.GroupLabel" DefaultValue="Test Group" /> 
       <bt:String id="Contoso.FunctionButton.Label" DefaultValue="Execute Function" /> 
      </bt:ShortStrings> 
      <bt:LongStrings> 
       <bt:String id="Contoso.FunctionButton.Tooltip" DefaultValue="Click to Show Taskpane1" /> 
      </bt:LongStrings> 
     </Resources> 
     </VersionOverrides> 



</OfficeApp> 

回答

1

您清單的問題是,您使用的是以下行:

<Label resid="residLabel5" />

但是你沒有定義的資源,residLabel5。如果您定義了您使用的所有資源,則清單纔有效。

將以下行添加到清單中的bt:ShortStrings時,可以解決問題。

<bt:String id="residLabel5" DefaultValue="Test" /> 
相關問題