Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
226 views
in Technique[技术] by (71.8m points)

c# - MS Word Document Operations are not working with IIS

I have opened a word document as follows

*Application wordApp = new ApplicationClass();
Document doc = null;
doc = wordApp.Documents.Open(ref docPath,
  ref setFalse, ref setFalse, ref setFalse, ref missing,
  ref missing, ref setTrue, ref missing, ref missing,
  ref missing, ref missing, ref setFalse, ref setFalse,
  ref missing, ref setTrue, ref missing);*

This is working fine with development server. But in IIS this is not working I have already given permission to ASPNET user in IIS,Folder and in dcomcnfg. Please help to solve this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Typically the accounts running web processes don't have enough os permissions to run GUI apps like Word. This is probably a good thing in most cases as one really shouldn't run GUI apps from web processes. What happens when word springs a modal dialog that blocks the entire site and no one is available to visit the web server and click OK. If you must read word docs, a library is a much better solution.

All that said, using word here makes zero sense -- you are just loading some stop words from a file. Plain text would be just as effective and vastly easier to deal with.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...