tulkas85
tulkas85

Reputation: 1103

Interop.Word Documents.Open stuck

I have same application on two different machine. On first machine all work fine, while in second machine I have a problem.

Debugging code I can see that when Interop.Word Documents.Open is called then execution remains locked, and never go to next code line, while browser (IE7) stuck on loading.

I need to open a word template, write in opened document, and then close it. So I do following :

_Application wdApp = new Application();
wdApp.Documents.Open(templatePath);

Why on first machine this works? There are reference problems ? I add same Interop dll in my machine...

In DCOM Config Settings I have same configuration on the two machine for Microsoft Word 97-2003 Documents:

identity -> Launching User

protection -> ASPNET user and ADMINISTRATOR with all permission

nothing appens, control never goes on next code line , and browser forever loading

Upvotes: 2

Views: 2809

Answers (1)

joecop
joecop

Reputation: 935

Sometimes the word.interop can cause the word document it has previously opened to become corrupt (if for example it did not save and close properly). This is not easily detected and word interop will behave as you have described. I have faced the same problem before. Try to delete the template file you are trying to open. Replace it with a new file. see if this helps at all.

Upvotes: 2

Related Questions