We have a scenario wherby we need to save a document on a file system and then open the file for editing on client side using Microsoft Word. We managed to save the document on server however we are getting problems in opening the file on the client computer.
We are using interop libraries, we are including Microsoft.Office.Interop.Word.dll and .xml in the Bin Folder of the deployed solution.
We are getting - Message: Object reference not set to an instance of an object.Inner Exception Data System.Collections.ListDictionaryInternalSource in line aDoc.Activate()
thanks ignatandrei for your input, we added a folder Desktop in C:\Windows\SysWOW64\config\systemprofile\ and it worked.
Now we have a problem that word is not initialising in neither the server nor the client. However the winword.exe is running on server, and we want to initialise the program on the client machine
we have a problem that word is not initialising in neither the server nor the client. However the winword.exe is running on server, and we want to initialise the program on the client machine
What if the client have not Word ? More, if you put on the server, you should deal with Marshall.ReleaseComObject everywhere( done this at a time - and it was a nightmare).
So I suggest you to find another tools - like aspose.
this will be an intranet application and all the client pcs will have word installed. We tried to include the marshal.releasecombobject but with no sucess.
mariacolette
0 Points
3 Posts
Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 09:38 AM|LINK
We have a scenario wherby we need to save a document on a file system and then open the file for editing on client side using Microsoft Word. We managed to save the document on server however we are getting problems in opening the file on the client computer.
We are using interop libraries, we are including Microsoft.Office.Interop.Word.dll and .xml in the Bin Folder of the deployed solution.
_Application wordApp = new ApplicationClass();
Documents d = wordApp.Documents;
Microsoft.Office.Interop.Word.Document aDoc = new Microsoft.Office.Interop.Word.Document();
aDoc = d.Open(ref file, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing, ref missing, ref missing, ref objTrue);
wordApp.Visible = true;
aDoc.Activate();
We are getting - Message: Object reference not set to an instance of an object.Inner Exception Data System.Collections.ListDictionaryInternalSource in line aDoc.Activate()
Do you have any solution to this please ?
thanks in advance
ignatandrei
All-Star
134913 Points
21619 Posts
Moderator
MVP
Re: Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 11:29 AM|LINK
verify adoc for null
(maybe the file path is not correct)
mariacolette
0 Points
3 Posts
Re: Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 11:44 AM|LINK
thanks ignatandrei for your input, we added a folder Desktop in C:\Windows\SysWOW64\config\systemprofile\ and it worked.
Now we have a problem that word is not initialising in neither the server nor the client. However the winword.exe is running on server, and we want to initialise the program on the client machine
ignatandrei
All-Star
134913 Points
21619 Posts
Moderator
MVP
Re: Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 12:02 PM|LINK
What if the client have not Word ? More, if you put on the server, you should deal with Marshall.ReleaseComObject everywhere( done this at a time - and it was a nightmare).
So I suggest you to find another tools - like aspose.
mariacolette
0 Points
3 Posts
Re: Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 12:16 PM|LINK
this will be an intranet application and all the client pcs will have word installed. We tried to include the marshal.releasecombobject but with no sucess.
wordApp.Visible = true;
aDoc = wordApp.ActiveDocument;
System.Runtime.InteropServices.Marshal.ReleaseComObject(wordApp);
aDoc.Activate();
ignatandrei
All-Star
134913 Points
21619 Posts
Moderator
MVP
Re: Opening Word Document on Client side from Intranet Web Application
Jul 04, 2012 01:06 PM|LINK
It's clear you are not a programmer - or, if you are one, read the use of Marshal.ReleaseComObject first....