使用 powerpoint 对象模型而不运行 powerpoint 应用程序
我需要创建一个服务器,允许多个用户连接、上传他们的 Powerpoint 演示文稿并获取修改后的演示文稿。演示文稿应同时处理(使用线程)。 Powerpoint 安装在服务器上。
有没有办法在不运行完整的 powerpoint 应用程序的情况下使用 powerpoint 对象模型? (我已经知道我可以使用 OpenXML,但我问的是对象模型。)
有人知道演示文稿是否确实可以同时处理(也许在不同的窗口或实例中)?
I need to create a server which allows multiple users to connect, upload their Powerpoint presentations and get modified presentations back. The presentations should be processed simultaneously (using threads). Powerpoint is installed on the server.
Is there a way to use the powerpoint object-model without running the full powerpoint application?
(I already know I can use OpenXML, but I'm asking about the object model.)
Anybody knows if presentations could indeed be processed simultaneously (perhaps in different windows or instances)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在自动化 PowerPoint 实例之前,必须有一个要自动化的 PowerPoint 实例。
如果不运行它,您就无法访问其对象模型。
PowerPoint 只允许其自身的一个实例,因此不可能同时存在多个实例,至少在每个用户登录的基础上是如此……您可以通过在多个登录会话中运行多个实例来使其运行。运行每个 PPT 副本的多个虚拟机可能是另一种可能性。
虽然您可以在单个 PPT 实例中打开多个演示文稿,但这会适得其反。它不会使处理发生得更快;可能会减慢速度,因为多个打开的演示文稿会消耗更多资源。
根据我的经验,最好的选择是序列化该过程,以便一次打开并处理一个文件。既然你提到了多个窗口,让我把这个扔进去:如果可能的话,不要在窗口中打开任何演示文稿;在大多数情况下,这是没有必要的,并且隐藏演示文稿会大大加快速度。
There has to be an instance of PowerPoint to automate before you can automate an instance of PowerPoint.
You can't access its object model without running it.
PowerPoint only allows one instance of itself, so multiple simultaneous instances isn't possible, at least on a per user login basis ... you might be able to make it fly by running multiple instances inside multiple login sessions. Mutltiple VMs running a copy each of PPT might be another possibility.
While you can open multiple presentations inside a single instance of PPT, it would be counterproductive. It wouldn't make the processing happen any more quickly; would probably slow things down because multiple open presentations would consume more resources.
In my experience, your best bet is to serialize the process so that you open and process one file at a time. Since you mention multiple windows, let me toss this in: if at all possible, don't open any presentations in a window; in most cases it's not necessary, and keeping the presentation hidden will speed things up considerably.