从 SharePoint 工作流运行 Word
基于加入MS Word文档我制作了一个控制台应用程序,将多个word文件拼接成一个。 现在我想从 SharePoint 中的工作流执行相同的操作。 简而言之,我的代码在失败之前如下所示:
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.ApplicationClass oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word._Document oDoc = null;
oWord.Visible = false;
Microsoft.Office.Interop.Word.Documents oDocs = oWord.Documents;
object oFile = tmpFileName;
oDoc = oDocs.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oDoc.Activate();
当我到达 oDoc.Activate() 时,我会抛出以下异常,即使我只有一个工作流程实例正在运行,并且没有其他 Word 实例在运行服务器:
消息过滤器表明应用程序正忙。 (HRESULT 异常:0x8001010A (RPC_E_SERVERCALL_RETRYLATER))
为什么我会收到此错误? 什么会使应用程序变得繁忙?
干杯
尼克
based on Join MS Word documents I have made a console application that splices multiple word files into one. Now I want to do the same from a Workflow in SharePoint. In short, my code before it fails looks like this:
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.ApplicationClass oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word._Document oDoc = null;
oWord.Visible = false;
Microsoft.Office.Interop.Word.Documents oDocs = oWord.Documents;
object oFile = tmpFileName;
oDoc = oDocs.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oDoc.Activate();
When I reach oDoc.Activate(), I'm thrown the following exception, even though I only have one instance of the workflow running and no other instances of Word is running on the server:
The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))
Why do I get this error?? What would make the application busy?
Cheers
Nik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它们是 Word 2007 文档,我认为您应该查看 Word 文件格式并查看 Microsoft 的文章是否有帮助:
,在服务器上运行是最后一件事我会推荐,除非确实没有其他方法可以做到。
在 Sharepoint 环境中,也许 文档转换器 可以以某种方式提供帮助,尽管我对它们没有任何经验——只是作为一个提示来看看。
If they are Word 2007 Documents, I think that you should look into the Word File Formats and see if the Article from Microsoft helps:
http://msdn.microsoft.com/en-us/library/bb656295.aspx
Office Interop is always a bit unstable, and running it on a server is the last thing I would recommend unless there is really no other way to do it.
In a Sharepoint Environment, maybe the Document Converters can somehow help, although I have no experience with them - just as a hint at something to look at.
Office 应用程序不是为在服务器环境中运行而构建的 - 它们纯粹是桌面应用程序。 不要从服务器呼叫他们。
The Office applications are not built to run in a server environment - they are purely desktop applications. Don't call them from a server.