2016-07-20 23 views
2

Ich arbeite an einem Office 2016 & Office 365-Add-in mit JavaScript und einer XML-Manifest-Datei. Wenn ich das Manifest online in Word lade, funktioniert alles wie erwartet. Es erstellt eine Registerkarte und platziert Schaltflächen auf dieser Registerkarte, die eine Funktion in der JavaScript-Datei aufrufen, die an die HTML-Datei angehängt ist, die in der Manifestdatei aufgeführt ist.Word-Add-in erstellt keine Schaltflächen in der Multifunktionsleiste

Allerdings, wenn ich dieses Add-in in Word 2016 (für Windows-Desktop) laden, funktioniert es nicht. Tatsächlich wird eine Taskleiste (auf der Seite) geöffnet, anstatt eine neue Registerkarte mit Schaltflächen zu erstellen. Hier ist das Dokument, das die Schritte auflistet, die ich ausgeführt habe, um das Add-In in Word für Desktop (Office Dev Center - Docs - Build Your First Word Add-in, unter dem Abschnitt "Probieren Sie es in Word 2016 für Windows") zu laden. Siehe unten für einen Ausschnitt meiner XML-Datei.

Ich habe das genaue Gegenteil Problem von this Frage, und ich habe genau was this Frage Antwort schlägt vor, aber es funktioniert nicht.

XML (aus dem ursprünglichen Geändert):

<?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> 

Hinweis: Diese Add-In funktioniert, wie ich in Word 365, aber nicht in Word 2016. Wer noch keine Ideen erwarten? Gibt es eine Option, die ich in meiner Installation von Office 2016 möglicherweise ändern muss, damit sie nicht richtig lädt?

Antwort

1

Add-In-Befehle (z. B. Menübandanpassung) waren in Office 2016 RTM nicht verfügbar. Stattdessen wurde die Funktionalität ein paar Monate später hinzugefügt und wird mit jedem monatlichen Build weiter iteriert und verbessert.

Wenn Sie Office 2016 RTM haben (z. B. wenn Sie es als eine CD/MSI-Installation als eigenständige Version erworben haben und nicht als Teil eines Office 365-Abonnements und des "immergrünen" Büros), haben Sie keine Add-In-Befehle aktiviert.

Nur um zu überprüfen: welche Versionsnummer sehen Sie, wenn Sie zu Datei -> Konto gehen?

enter image description here

+0

Meine Büroversion ist 16.0.6741.2048. Ich habe ein Office 365 ProPlus-Abonnement. –

+0

@RyanAndrews: Erfolg, wenn Sie Ihre Office-Installation aktualisieren? –

+1

@RyanAndrews: Die Dokumentation der Beispiele für [Office-Add-In-Befehle] (https://github.com/OfficeDev/Office-Add-in-Commands-Samples) gibt an, dass mindestens die Version 16.0.6769.0000 oder höher (16.0.6868.0000 wird empfohlen). –