服务器上的文字自动化
我们要求我们的网络应用程序能够进行邮件合并,并且 生成一些Word文档。 当然,这很容易使用 Word 自动化,但 Microsoft 不推荐 http://support.microsoft.com/kb/257757。
“微软目前不推荐也不支持, Microsoft Office 应用程序在任何无人值守的情况下实现自动化, 非交互式客户端应用程序或组件(包括 ASP、 ASP.NET、DCOM 和 NT 服务),因为 Office 可能表现出不稳定 Office 在此环境中运行时的行为和/或死锁。”
在这种情况下人们通常会做什么?只需接受 Word 偶尔会挂起或寻求某些第三方解决方案。
We have a requirement that our web app will do a mail merge and
generate some Word documents. Of course this is very easy to do using
Word automation but is not recommended by Microsoft
http://support.microsoft.com/kb/257757.
"Microsoft does not currently recommend, and does not support,
Automation of Microsoft Office applications from any unattended,
non-interactive client application or component (including ASP,
ASP.NET, DCOM, and NT Services), because Office may exhibit unstable
behavior and/or deadlock when Office is run in this environment."
What do people generally do in this situation? Just accept that Word
will occasionally hang or go for some third party solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上你有三个选择:
从个人经验来看,我已经完成了第一个,并且效果很好,足以让我们的客户接受,第二个我搞砸了,但从未感到满意,而我已经完成了第三个,取得了巨大的成功(但需要相当多的工作)。
简而言之,人们会根据成本(时间等)与可靠性来采取各种措施:我建议选择 1 或 2 来获得快速(但不太可靠)的解决方案,或者选择 3 来获得更可靠(但成本较高)的解决方案。
Basically you have three choices:
From personal experience I've done the first and it worked well enough for our customer to accept, I messed around with the second and was never satisfied, and I've done the third with great success (but a fair bit of work).
In short, people do all sorts depending on cost (time etc) vs. reliability: I'd suggest option 1 or 2 for a fast (but less reliable) solution, or 3 for a more reliable (but costly) one.
我使用自动化构建了一个 Powerpoint 应用程序。 基本上,它是一个幻灯片库网站,可以打开多个文件并将幻灯片移动到模板中。
我遇到的第一个问题是安全性,我最终将应用程序设置为以管理员身份运行,这是不推荐的,并且大多数地方可能会对此操作感到不满。 您需要灵活地自定义安全设置。
我确实经历了一些我们从未追踪到的应用程序池崩溃,而且我相信我还必须让用户始终登录到远程桌面,但始终断开连接。
最重要的是,你可以让自动化工作,但它很麻烦。 如果您有灵活性并且自动化是您最好的选择,那么就去做吧。 否则我有两个想法。
I built a Powerpoint application using automation. Basically it was a Slide Library Website that opened multiple files and moved slides into a template.
The first issue I encountered was security, I ended up setting the application to run as administrator, which isn't recommended and most places would probably frown apon that action. You will need to have the flexibility to customize the security settings.
I did experience a few app pool crashes that we're never tracked down, and I believe I also had to have a user logged into the Remote Desktop, but disconnected, at all times.
Bottom line is you can get automation to work, but its hacky. If you have the flexibility and automation is your best bet then go for it. Otherwise I have two thoughts.