Milad Vm
Milad Vm

Reputation: 3

Word Documents.Open returns null in ASP.NET windows server 2012 R2

I have a web application that initial some information into word file (using text form).

when visual studio run it, its work currently but when I publish it and run in IIS, intrupt.word return null in open document .

I find some solution but that's not work for windows server 2012 R2 some solution like change the launching user to the interactive user or create "Desktop" directory in C:\Windows\SysWOW64\config\systemprofile path or C:\Windows\System32\config\systemprofile path all of this solution work very well for windows server 2008 and older but don't work for windows server 2012 R2

I find my own solution

In first I used interrupt for working with word while it's not good for web (unlike win App) application after searching I fined Aspose that have complete method for working with Word and it's compatible with web application.

Upvotes: 0

Views: 1100

Answers (2)

Milad Vm
Milad Vm

Reputation: 3

I find my own solution I do what Jeremy Thompson said In first I used interrupt for working with word while it's not good for web application (unlike win App) after searching I fined Aspose that have complete method for working with Word and it's compatible with web application.

Upvotes: 0

Jeremy Thompson
Jeremy Thompson

Reputation: 65544

Use an XML library (like ClosedXml) instead of Word Interop.

The most likely reason why it doesn't work via IIS is because Server-side automation of Office is not supported as per https://support.microsoft.com/en-us/kb/257757

Upvotes: 2

Related Questions