2017-07-04 7 views
1

Ich mache ein Office-Add-in, das zwei Multifunktionsleisten-Schaltflächen hat. Jede Taste ist mit einem anderen TaskpaneId verknüpft, und klicken auf jeder Schaltfläche öffnet eine andere TaskPane:Zwei offene Taskpanels nebeneinander

<bt:Urls> 
    <bt:Url id="Contoso.Taskpane1.Url" DefaultValue="https://localhost:3000/addin/page1" /> 
    <bt:Url id="Contoso.Taskpane2.Url" DefaultValue="https://localhost:3000/addin/page2" /> 
</bt:Urls> 

Es scheint, dass ich einig Office-Add-In zu sehen, wo zwei Aufgabenbereiche Seite gezeigt werden können sie gleichzeitig (I vergessen, welche genau die Add-Ins sind). Ich brauche das von Zeit zu Zeit, weiß jemand, wie man das realisiert?

Antwort

0

Script Lab ist ein solches Add-In. Alles, was Sie tun müssen, ist zwei verschiedene Tasten zu erstellen, die eine ShowTaskpane Aktion mit verschiedenen IDs haben.

Beispiel von Script-Lab-prod manifestieren: https://github.com/OfficeDev/script-lab/blob/master/manifests/script-lab-prod.xml

  <Control xsi:type="Button" id="PG.CodeCommand"> 
       <Label resid="PG.CodeCommand.Label" /> 
       <Supertip> 
       <Title resid="PG.CodeCommand.TipTitle" /> 
       <Description resid="PG.CodeSupertip.Desc" /> 
       </Supertip> 
       <Icon> 
       <bt:Image size="16" resid="PG.Icon.Code.16" /> 
       <bt:Image size="32" resid="PG.Icon.Code.32" /> 
       <bt:Image size="80" resid="PG.Icon.Code.80" /> 
       </Icon> 
       <Action xsi:type="ShowTaskpane"> 
       <TaskpaneId>Office.AutoShowTaskpaneWithDocument</TaskpaneId> 
         <===== A taskpane ID. This one is a "special" one that allows the taskpane 
           to auto-open if a document is marked as belonging to the add-in. 

       <SourceLocation resid="PG.Code.Url" /> 
       <Title resid="PG.CodeCommand.Title" /> 
       </Action> 
      </Control> 
      <Control xsi:type="Button" id="PG.RunCommand"> 
       <Label resid="PG.RunCommand.Label" /> 
       <Supertip> 
       <Title resid="PG.RunCommand.TipTitle" /> 
       <Description resid="PG.RunSupertip.Desc" /> 
       </Supertip> 
       <Icon> 
       <bt:Image size="16" resid="PG.Icon.Run.16" /> 
       <bt:Image size="32" resid="PG.Icon.Run.32" /> 
       <bt:Image size="80" resid="PG.Icon.Run.80" /> 
       </Icon> 
       <Action xsi:type="ShowTaskpane"> 
         <===== Whereas this one dosn't specify a taskpane ID, 
           and so it is different by default (but probably 
           should be explicit, come to think of it...) 

       <SourceLocation resid="PG.Run.Url" /> 
       <Title resid="PG.RunCommand.Title" /> 
       </Action> 
      </Control> 

Für die Auto-Open siehe insbesondere https://dev.office.com/docs/add-ins/design/automatically-open-a-task-pane-with-a-document.

+0

Sorry Michael, funktioniert es in Excel Online? Ich kann 2 Aufgabenbereiche von Script Lab in Excel Online nicht nebeneinander stellen ... – SoftTimur

+0

Sie können sie nicht nebeneinander legen, aber Sie werden sehen, dass sie vertikal mit Registern versehen sind. Sie können also tatsächlich zwei öffnen, es ist nur so, dass jeweils nur einer sichtbar ist. Wenn Sie mehr Benutzeroberflächenflexibilität wünschen, schlage ich vor, dass Sie ein Problem auf https://officespdev.uservoice.com/ anmelden. –