简体   繁体   English

使用 ActiveXObject 或 Office Javascript API 将电子邮件保存到 Outlook 文件夹?

[英]Save email to outlook folder using ActiveXObject or Office Javascript API?

In outlook, there is a feature “Home page address” of folder through which we can view web site within the outlook.在outlook中,有一个文件夹的“主页地址”功能,通过它我们可以在outlook中查看网站。 If we set http://app.abctest.com in the Home page address of a folder, then when we click this folder in the outlook, it will display that page.如果我们在一个文件夹的首页地址中设置http://app.abctest.com ,那么当我们在outlook中点击这个文件夹时,就会显示那个页面。

I have a very specific requirement for enabling end user to browse a web site (in my case, it basically lists some archived emails) within from the Outlook.我有一个非常具体的要求,使最终用户能够从 Outlook 浏览网站(在我的例子中,它基本上列出了一些存档的电子邮件)。 This can be easily done by setting the “Home page address” in the properties windows of any Folder of Outlook.这可以通过在任何 Outlook 文件夹的属性窗口中设置“主页地址”来轻松完成。

The user will see the page within outlook.用户将在 Outlook 中看到该页面。 He can search the old archived emails in the page.他可以在页面中搜索旧的存档电子邮件。 Then, the users should be able to download that email and save it to a folder in outlook.然后,用户应该能够下载该电子邮件并将其保存到 Outlook 中的文件夹中。 End users are basically searching the emails within outlook and downloading them from the server directly to their outlook folder.最终用户基本上是在 Outlook 中搜索电子邮件并将它们从服务器直接下载到他们的 Outlook 文件夹中。 When user click the download\\save link or button, then the outlook's “Select Folder” dialog should appear where user can select the destination folder.当用户单击下载\\保存链接或按钮时,应出现 Outlook 的“选择文件夹”对话框,用户可以在其中选择目标文件夹。 When user click “OK” button, that email should be save to the selected folder in the outlook.当用户单击“确定”按钮时,该电子邮件应保存到 Outlook 中的选定文件夹中。

Currently, I have very few solutions but not sure if they can achieve the goal.目前,我的解决方案很少,但不确定它们是否可以实现目标。

Solution 1: ActiveXObject解决方案 1:ActiveXObject

I tried to use Outlook ActiveXObject in javascript (used the following code in my test page) but I got the following Script error Popup message.我尝试在 javascript 中使用 Outlook ActiveXObject(在我的测试页中使用了以下代码),但收到以下脚本错误弹出消息。

“Automation server cannot create the object”. “自动化服务器无法创建对象”。 Javascript code: var objO = new ActiveXObject('Outlook.Application'); Javascript 代码:var objO = new ActiveXObject('Outlook.Application');

Solution 2: Javascript API for Office解决方案 2:用于 Office 的 Javascript API

I have started to read the MSDN documentation https://msdn.microsoft.com/en-us/library/office/fp142185.aspx but have not got any sample code.我已经开始阅读 MSDN 文档https://msdn.microsoft.com/en-us/library/office/fp142185.aspx但没有任何示例代码。

Could someone please sheds some light on it?有人可以解释一下吗? Or what would be the best solution for this?或者什么是最好的解决方案? Or any alternative solution.或任何替代解决方案。

Prakash,普拉卡什,

Only one instance of Outlook can be run at the same time.只能同时运行一个 Outlook 实例。 Try to use the GetObject function instead to get the running Outlook instance instead.尝试改用GetObject函数来获取正在运行的 Outlook 实例。 See How to programmatically create an Outlook home folder page in the Outlook Today style for more information.有关详细信息,请参阅如何以编程方式创建 Outlook Today 样式的 Outlook 主文件夹页面 However, home page scripting is limited and secured to prevent malicious software.但是,主页脚本受到限制并受到保护以防止恶意软件。 I'd suggest developing an add-in which can add a custom form instead.我建议开发一个可以添加自定义表单的插件。

The second solution listed above is for Mail Apps.上面列出的第二个解决方案适用于邮件应用程序。 See How to: Create your first mail app for Outlook by using Visual Studio for more information.有关详细 信息,请参阅 如何:使用 Visual Studio 创建第一个 Outlook 邮件应用程序

当您的脚本在文件夹主页内运行时,window.external.OutlookApplication 将指向 Outlook.Application 对象之外的一个实例 - 您应该能够在不创建新对象的情况下使用它。

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

相关问题 使用HTML / Javascript表单使用ActiveXObject创建带有嵌入式图像的Outlook电子邮件 - Use a HTML/Javascript form to create outlook email with embedded images using ActiveXObject 无法使用具有多个附件的JS Outlook ActiveXObject发送电子邮件 - Not Able to send an Email Using JS outlook activexobject with multiple attachements Javascript:使用ActiveXobject保存文件 - Javascript: Save file with ActiveXobject 任何人都可以告诉我用于使用 Microsoft Outlook 发送电子邮件的 Firefox 和 chrome 的 activexobject 的任何替代方案吗? - can anyone tell me any alternative of activexobject for firefox and chrome for sending email using microsoft outlook? 使用HTA的Office / Outlook Javascript插件? - Javascript Plugin for Office/Outlook using HTA? 使用 ActiveXObject 在 javascript 中创建 xls - Creating xls in javascript using ActiveXObject 如何使用 VBA 在 Office 365 Outlook 中撰写电子邮件? - How to compose email in office 365 outlook using VBA? javascript 使用 ActiveXObject 运行客户端的 oulook,附件来自本地系统上的 Downloads 文件夹 - javascript to run client's oulook using ActiveXObject with attachment from the Downloads folder on the local system 从Outlook Office REST API获取联系人计数-Javascript - Getting a Count of Contacts from Outlook Office REST API - Javascript JavaScript ActiveXObject - JavaScript ActiveXObject
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM