如果URI是localhost,则addFileAttachmentAsync在Office 365中工作吗? [英] does addFileAttachmentAsync work in Office 365 if the URI is localhost?

查看:74
本文介绍了如果URI是localhost,则addFileAttachmentAsync在Office 365中工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Outlook插件,此时我将所有东西都放在本地。

I am developing an Outlook addin and at this time I have everything local.

我调用addFileAttachmentAsync将localhost作为URI传递,因为它是一个动态生成的ASP来自ASP .Net application。

I am calling addFileAttachmentAsync passing localhost as the URI because it's a dynamically generated URL from an ASP.Net application.

这就是我的工作:

Office.context.mailbox.item.addFileAttachmentAsync(

Office.context.mailbox.item.addFileAttachmentAsync(

" https:// localhost:44302 / Default.aspx?FileId = AF058"
" att1.txt" ; ,{ asyncContext:
null },addAttachCallback);

"https://localhost:44302/Default.aspx?FileId=AF058", "att1.txt", { asyncContext: null}, addAttachCallback);

问题是,如果我在Office 365中它不起作用,如果我在Outlook 2016中它可以正常工作。

The problem is that it does not work if I am inside Office 365 and it Works OK if I am in Outlook 2016.

我想这是在Outlook 2016中,页面在本地呈现,因此它可以很好地访问localhost,而在Office 365中,我是远程的,localhost实际上不是我的计算机,而是放置电子邮件的服务器。

I guess that in Outlook 2016 the page is rendered locally so it can well access localhost, while in Office 365 I am remotely and localhost is in fact not my computer but the server where the email is placed.

我是对的吗?

推荐答案

嗨Pablo,

Hi Pablo,

你是对的。根据我的理解,Office API最终由Office产品执行。如果加载项托管在Outlook 2016中,那么Outlook 2016将在计算机上请求URL,以便它在我们开发Office加载项时有效。

You are right. Based on my understanding, the Office API is executed by the Office product finally. If the add-in was hosted in Outlook 2016, then Outlook 2016 will request the URL on the computer, so that it works when we develop the Office add-in.

然而,当我们通过Of运行Office加载项时fice 365,该功能应由Outlook在线执行。在您提出动议时,由于远程服务器上没有此类文件,因此无法获取该文件。

However, when we run the Office add-in through Office 365, the function should be executed by the Outlook online. As you motioned, it will not get the file as there is not such file on the remote server.

问候 & Fei

Regards  & Fei


这篇关于如果URI是localhost,则addFileAttachmentAsync在Office 365中工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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