Outlook 自动化从 Web 应用程序创建约会
使用 ActiveX 技术从 Web 应用程序实现 Outlook 自动化是标准做法吗?这与从 Web 应用程序本身安排约会的 Web 调度程序(如 Telerik 的 RadScheduler + Telerik 的 Exchange Provider)相比如何?
谢谢,
森德希尔
Is it a standard practice to automate outlook from a web application using ActiveX technology? How does this compare with a web scheduler like telerik's RadScheduler + telerik's Exchange Provider to schedule an appointment from the web application itself?
Thanks,
Sendhil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将需要提供有关您想要完成的任务的更多详细信息,而不仅仅是说明 Web 应用程序中 Outlook 的自动化。我之所以这么说是因为这实际上取决于您想要做什么。如果您想做的只是创建一个约会,那么您不需要 activex。
您可以研究或研究以下内容。立即进入 Outlook,创建约会。然后转到文件菜单并执行“另存为”并将约会保存到桌面上。您会注意到该文件存储为 .ics 文件。您实际上可以在记事本或word中打开该文件并查看其内容。
例如,下面是记事本中的示例:
现在想想,您可以使用 asp.net/asp 生成约会,因为您可以访问 StreamWriter 和内存流。这到底是什么意思,这意味着您可以生成一个像这样的文本文件,猜猜如果您生成这样的文本文件然后您刚刚创建了一个约会会怎么样。这是我为日历项目编写的示例,我编写了一个工具来跟踪我工作的公司的假期/休假请求。经理想要的功能之一是将员工请求添加到经理日历中。由于经理总是在 Outlook 中,他们希望快速浏览一下 Outlook 日历,看看谁在办公室,谁不在办公室。当然,他们可以手动创建 Outlook 日历项目,但过多的手动工作并不理想。
因此,我使用 StreamWriter 和内存流来生成 Outlook 日历项目。
这是一个例子:
You will need to provide more details about what you are trying to accomplish rather then just stating automation of outlook within a web application. The reason I say this is because it really depends on what you are trying to do. If all you are trying to do is create an appointment then no you do not need activex.
Here is something you can research or look into. Go into outlook right now, create an appointment. Then go to the file menu and do a "Save As" and save the appointment onto your desktop. You will notice the file is stored as a .ics file. You can actually open this file in notepad or word and view the contents of it.
For example here is a sample of what it looks like in notepad:
So now think about this, you can use asp.net / asp to generate an appointment because you have access to a StreamWriter and a memory stream. What exactly does this mean, it means you can generate a text file just like this and guess what if you generate a text file like this then you just created an appointment. Here is an example I wrote for a calendar item, I had written a tool to track vacation / time off requests for a company I work at. One of the features managers wanted was a way to add the employee request to the managers calendar. Due to managers always being inside of outlook they wanted to quickly glance at their outlook calendar and see who was in the office and who wasn't. Sure they could manually create the outlook calendar item but too much manual work was not ideal.
So I used a StreamWriter and a memory stream to generate an outlook calendar item.
Here is an example:
您可以通过多种方法从 ASP.NET 应用程序实现 MS Office 自动化,但您需要自行承担风险。如果我没记错的话,您很可能需要使用模拟才能使 dcom 正常运行,这样做可能会在您的 Web 应用程序中留下一个大的安全漏洞。
我建议使用 Open Office XML 因为 MS 不推荐也不支持从 Web 应用程序中自动化 Office。
There are ways that you can automate MS office from an asp.net application but such you do so at your own risk. If I remember correctly, you will more than likely need to use impersonation in order for dcom to function correctly and in doing so you will possibly leave a large security hole in your web application.
I would suggest using Open Office XML as MS does not recommend nor support automating Office from within a web application.