简体   繁体   English

Office Addin 以编程方式加载最新版本

[英]Office Addin load latest version programmatically

I am developing an Office addin, there is a requirement from client that latest version of addin should load on user's system.我正在开发一个 Office 插件,客户端要求最新版本的插件应该加载到用户的系统上。 It will be deployed as Admin Managed addin, but when we upload a new version it is not auto updated.它将被部署为管理员管理插件,但是当我们上传新版本时,它不会自动更新。 User has to go to Office Add-in screen and press refresh button.用户必须 go 到 Office 加载项屏幕并按刷新按钮。 Is there some way that I can perform these steps programmatically.有什么方法可以让我以编程方式执行这些步骤。

Also if I cannot do the above auto refresh, can I clear Office cache through javascript on my taskpane so that next time it loads latest version?此外,如果我无法执行上述自动刷新,我是否可以通过任务窗格上的 javascript 清除 Office 缓存,以便下次加载最新版本? I know that I can clear chache manually , but I want to achieve it programmatically.我知道我可以手动清除 chache ,但我想以编程方式实现它。

If I cannot achieve both of the above tasks, can we deploy Office-js addin as click-once app as we can do with VSTO apps?如果我无法完成上述两项任务,我们是否可以像使用 VSTO 应用程序那样将 Office-js 插件部署为单击一次应用程序?

can we deploy Office-js addin as click-once app as we can do with VSTO apps?我们可以像使用 VSTO 应用程序那样将 Office-js 插件部署为单击一次应用程序吗?

No, Office web add-ins (OfficeJS) can't use ClickOnce for deployments.不,Office web 加载项 (OfficeJS) 不能使用 ClickOnce 进行部署。 You can read about possible ways of deployments in the Deploy and publish Office Add-ins article.您可以在部署和发布 Office 加载项一文中了解可能的部署方式。

can I clear Office cache through javascript on my taskpane so that next time it loads latest version?我可以通过任务窗格上的 javascript 清除 Office 缓存,以便下次加载最新版本吗?

Nope.没有。 Instead, you can set up http-properties on the files.相反,您可以在文件上设置 http-properties。 Use Cache-control HTTP directives to control who can cache the response, under which conditions, and for how long.使用Cache-control HTTP 指令来控制谁可以缓存响应、在什么条件下以及缓存多长时间。 See Guide for Caching and HTTP Cache Headers for Static Content for more information.有关更多信息,请参阅缓存指南和 Static 内容的 HTTP 缓存标头

So, you may instruct the end point (web browser) for how long to keep old files and when to refresh them.因此,您可以指示端点(网络浏览器)保留旧文件的时间以及何时刷新它们。 Going that way you may force the browser to update the add-in files.这样,您可能会强制浏览器更新加载项文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM