Office 2016外接程序-可以在启动外接程序时打开远程文件吗? [英] Office 2016 Addin - Is possible Open remote file on startup addin?

查看:146
本文介绍了Office 2016外接程序-可以在启动外接程序时打开远程文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以打开一个远程文件(url,xml,二进制文件)?

Is possible open a remote file (url, xml, binary) ?

例如,我使用Add-In(从url)打开一个虚拟docx,然后Addin从url检索xml docx并将其放入打开的文档中(替换文档的虚拟对象).

For example, I open a dummy docx with Add-In (from url) then the Addin retrieve a xml docx from url and put it in opened document (replace document dummy).

可能吗?

谢谢.

P.S .:我创建了一个插件,并从打开的虚拟文件上的URL中检索了一个xml docx,但是我无法放入打开的文档中(替换).

P.S.: I create a Addin and I retrieve a xml docx from url on open dummy file but I fail to put into opened document (replace).

推荐答案

如果我理解正确,那么您将要完成自己想要做的事情.拥有docx文件后,您需要对它进行base64编码. 此处是关于此的SO帖子.编码完成后,您将在

If I understand correctly, you are close to doing what you want. Once you have the docx file, then you need to base64 encode it. Here's a SO post about this. Once it is encoded, then you'll use the insertFileFromBase64 method on the Body object.

bodyObject.clear(); 
bodyObject.insertFileFromBase64(base64docxfile); 

下面是一个相关示例,该示例对服务进行了base64编码(与您想要的不同),然后进行

Here's a related example that does the base64 encoding on the service (different than what you want), and then clears the dummy doc and opens the docx file in the client.

这篇关于Office 2016外接程序-可以在启动外接程序时打开远程文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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