仅适用于Word桌面的Office加载项 [英] Office add-in for Word desktop only

查看:119
本文介绍了仅适用于Word桌面的Office加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Word加载项,并且使用对内容控件的编辑,而Word联机仍不支持该控件,我还使用Binding.bindingDataChanged事件,而Word Online也不支持该事件.

I'm working on Word add-in and I use editing of content controls which is still not suported in Word online, I also use Binding.bindingDataChanged event which is also not supported in Word online.

如果没有使用这些功能的功能,则该加载项对用户完全没有用.我想将该加载项提交到Office应用商店,但使其仅在Word桌面版本中可用.

Without features that uses these capabilities the add-in is is not usefull at all for the users. I would like to submit the add-in to the Office store, but to make it available only in Word desktop version.

为此,我尝试在清单xml文件中使用需求集规范. 我已经审核了需求集文档页面 https ://dev.office.com/reference/add-ins/requirement-sets/office-add-in-requirement-sets ,但找不到我应该使用的集. 我认为Binding.bindingDataChanged事件应属于BindingEvents要求集,但文档指出此集受Word Online支持.我也不知道如何指定我需要使用需求集来编辑功能的内容控件.

For this purpose i have tried to use Requirement sets specification in the manifest xml file. I have ckecked requirement sets documentation page https://dev.office.com/reference/add-ins/requirement-sets/office-add-in-requirement-sets but could not find what sets I should use. Binding.bindingDataChanged event I think should belong to BindingEvents requirement set, but the documentation states that this set is supported by Word Online. I also dont know how to specify that I need content controls editing capabilites by using requirements sets.

我尝试添加在此处找到的Word桌面2016所需的所有需求集 https://dev.office.com/add-in-availability ,这样我的清单需求集部分看起来像这样

I tried to add all requirement sets needed for Word desktop 2016 I found here https://dev.office.com/add-in-availability so that my manifest requirement sets part looks like this

<Requirements>
        <Sets DefaultMinVersion="1.1">
          <Set Name="BindingEvents"/>
          <Set Name="CompressedFile"/>
          <Set Name="CustomXmlParts"/>
          <Set Name="DocumentEvents"/>
          <Set Name="File"/>
          <Set Name="HtmlCoercion"/>
          <Set Name="ImageCoercion"/>
          <Set Name="OoxmlCoercion"/>
          <Set Name="TableBindings"/>
          <Set Name="TableCoercion"/>
          <Set Name="TextBindings"/>
          <Set Name="TextFile"/>
          <Set Name="Settings"/>
          <Set Name="TextCoercion"/>
          <Set Name="MatrixCoercion"/>
          <Set Name="MatrixBindings"/>
          <Set Name="WordApi" MinVersion="1.2"/>
        </Sets>
      </Requirements>

但是当我通过将加载项添加到我的sharepoint应用程序目录中进行测试时,仍然可以尝试通过Word进入插入"->"Office加载项"从Word在线使用它,因此它仍然显示在我的组织"下,因此我能够单击它并将其加载到任务窗格中. 有没有办法使用清单文件中的需求集来阻止外接程序在Word在线中可用,还是应该使用运行时检查或其他方法?

But still when I test it by adding the add-in to my sharepoint apps catalog and try to use it from Word online by going to Insert->Office Add-ins it still shows in under MY ORGANIZATION so I'm able to click on it and load it in the task pane. Is there a way to prevent the add-in to be available in Word online using reqirement sets in manifest file or should i use runtime checks or something else?

推荐答案

我将在"注意:名称属性指定可以运行加载项的Office主机应用程序.Office主机在不同平台上受支持,并且可以在台式机,Web浏览器,平板电脑和移动设备上运行.您无法指定哪个平台可以用来运行您的加载项.例如,如果您指定Mailbox,则Outlook和Outlook Web App都可以用来运行您的加载项."

"Note: The Name attribute specifies the Office host application that can run your add-in. Office hosts are supported on different platforms and run on desktops, web browsers, tablets, and mobile devices. You can't specify which platform can be used to run your add-in. For example, if you specify Mailbox, both Outlook and Outlook Web App can be used to run your add-in."

基本上,它说您不能通过清单使外接程序仅适用于桌面版.您仍然可以按照此处所述在运行时检查主机: Office.context的添加.

Basically it says you cannot make add-in available only for Desktop version via manifest. You still have the option to check the host at run time as described over there: Use runtime checks in your JavaScript code. You may also look at Additions to Office.context.

这篇关于仅适用于Word桌面的Office加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆