Reputation: 63
When i trying to open the document (.doc or .docx) instance of document is NULL.
Application wordApplication = new Application();
wordApplication.Visible = false;
Document wordDocument = wordApplication.Documents.Open("C:\\doc.doc");
And why is wordApplication.Documents.Count equal of zero?
(Windows Server 2008 R2 x64, MS Office 2010 x64)
Upvotes: 3
Views: 16419
Reputation: 4567
This helped me several years ago.
Inlined
There are several suggested answers, I tried the second one and it solved my problem. But I'm inlining all of them here/.
1-st approach: try to create a new "Desktop" directory inside of "C:\Windows\SysWOW64\config\systemprofile\"
2-nd: you must change the identity of word component in windows\System32\comexp.msc
to be interactive user instead of launching user.
3-rd:
0. Set the DCOM Config Setting for "Microsoft Office Word 97 - 2003 Document"
(Open the properties > Identity Tab > Select "The interative User"
Secutiry Tab > Lanuch and Acctivation Permissions > Add Network Serivce
Upvotes: 6