简体   繁体   English

错误:单词自动化

[英]error : word automation

I have IIS7(Windows Server 2008) 64bit but my application is running in 32bit mode. 我有IIS7(Windows Server 2008)64位,但是我的应用程序以32位模式运行。 Ms Office 2003 is installed on server. Office 2003女士已安装在服务器上。 I cannot find {000209FF-0000-0000-C000-000000000046} in Component Services but I can see {00020906-0000-0000-C000-000000000046} and I assigned all permissions for it too. 我在组件服务中找不到{000209FF-0000-0000-C000-000000000046},但可以看到{00020906-0000-0000-C000-000000000046},我也为其分配了所有权限。

If I apply impersonation then I see winword.exe*32 in task manager and page in progress for long long time just like stick, no response/ error. 如果我进行模拟,那么我会在任务管理器中看到winword.exe * 32,并且页面长时间处于运行状态,就像粘贴一样,没有响应/错误。 I noticed that page goes stick/always in progress with 我注意到该页面会一直显示/始终在

'' Passed and no error with impersonation ''已通过且模拟没有错误

Dim WordApp As Microsoft.Office.Interop.Word.Application = New Microsoft.Office.Interop.Word.Application

'' Passed and no error with impersonation ''已通过且模拟没有错误

Dim objDoc As Microsoft.Office.Interop.Word.Document = New Microsoft.Office.Interop.Word.Document

'' With impersonation, this line of code stick page to long process - Documents.Open ''具有模拟功能,这行代码会将页面粘贴到很长的过程-Documents.Open

objDoc = WordApp.Documents.Open(path)

What I am missing? 我缺少什么? Same code was working with Windows Server 2003 64 bit. 相同的代码与Windows Server 2003 64位一起使用。

Office Interop is not designed for sever side use. Office Interop不适用于服务器端使用。 Microsoft has a Knowledge Base article on the topic of server-side automation of Office, you may want to read though it. Microsoft有一个有关Office服务器端自动化的主题的知识库文章,您可能需要阅读。

Without knowing what you are trying to use the interop for, all I can recommend is switch to using Office OpenXML for your sever automation. 在不知道您要如何使用互操作性的情况下,我所建议的就是切换到使用Office OpenXML进行服务器自动化。 If you are just doing document manipulation it should allow you to do that. 如果您只是在进行文档操作,则应允许这样做。 For anything else I would recommend looking over the suggestions for alterintives in the KB article I linked. 对于其他事项,我建议您查看我链接的知识库文章中有关替代方案的建议。


If you really must there is a hack solution to your problem 如果您确实需要针对您的问题的解决方案

if you create the folder C:\\Windows\\SysWOW64\\config\\systemprofile\\Desktop and C:\\Windows\\System32\\config\\systemprofile\\Desktop it may solve your problem, but if you can I would highly recommend using OpenXML instead. 如果创建文件夹C:\\Windows\\SysWOW64\\config\\systemprofile\\DesktopC:\\Windows\\System32\\config\\systemprofile\\Desktop它可能会解决您的问题,但是如果可以,我强烈建议您使用OpenXML。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM