Office add-in with both taskpane and content?

2019-02-15 21:48发布

问题:

I spent all night looking this up and can't find it.

Is it possible to have an Excel/Office add-in that has both content and taskpane components?

Really, I want a content app, but I want extra options/buttons in the ribbon and taskpane that will trigger different actions/changes in my content app. Whenever I try to add the VersionOverrides xml node to my manifest on a content app, it always fails. None of my buttons show up. All the examples I can find that work have the namespace [...]/taskpaneappversionoverrides. I've tried changing it to [...]/contentappversionoverrides but that doesn't work either.

The reason I want this is because inserting a content app is obtuse because you have to go to Insert > My Addins > Select add in. It is hard to find. But it is really easy to trigger actions when they've installed a taskpane add in.

   <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
   <Hosts>
     <Host xsi:type="Workbook">
       <DesktopFormFactor>
         <GetStarted>
         ... custom tab, groups, buttons, etc

回答1:

It is not possible to launch a taskpane from a content add-in and commands are only supported for the taskpane manifest. An alternative for your scenario is to have a content add-in and then, to declutter some of the UI in your content add-in, use the dialog API (E.g. have a gear icon than then opens the dialog for more real state where you present more options).

Longer term I'm thinking we should have an API to allow you to insert web objects on the document. So the model would be to just have a single "add-in" concept, that has commands, and then from commands you use APIs to do stuff, including inserting web objects into the document, displaying dialogs, or panes.



回答2:

At this time you can only show a taskpane or a dialog through an add-in command. It is a scenario that we've heard and we have in our roadmap to address (not committed date yet). We can reply to this thread when the functionality is available for preview.

Is there a particular scenario you want where you'd need this to be a content add-in (i.e. a data visualization?).

thanks