Runtime error with MS Word
-
Hi all, Ok here is the scenario. I wrote an application which reads information from a access database and then the user has the option to export it to an MS word Document. This work 100% on some machines but troughs a Runtime error on other. Here is a code snippet. ApplicationClass wordApp = new Word.ApplicationClass(); //Error when creating event. wordApp.DocumentBeforeClose += new Word.ApplicationEvents4_DocumentBeforeCloseEventHandler(wordApp_DocumentBeforeClose); I almost don't see this being a code/logical error, may it be the version of Office that differs on the PC's? Thanx in advance ;)
-
Hi all, Ok here is the scenario. I wrote an application which reads information from a access database and then the user has the option to export it to an MS word Document. This work 100% on some machines but troughs a Runtime error on other. Here is a code snippet. ApplicationClass wordApp = new Word.ApplicationClass(); //Error when creating event. wordApp.DocumentBeforeClose += new Word.ApplicationEvents4_DocumentBeforeCloseEventHandler(wordApp_DocumentBeforeClose); I almost don't see this being a code/logical error, may it be the version of Office that differs on the PC's? Thanx in advance ;)
I have seen some issues, where if office is installed before the .net framework. The .net hooks into office don't get installed. So if you go into add remove programs and fix the install of office you should see a .net option that wasn't there before, if you istall the .net hooks then it should work for you. Hope that helps. Ben
-
I have seen some issues, where if office is installed before the .net framework. The .net hooks into office don't get installed. So if you go into add remove programs and fix the install of office you should see a .net option that wasn't there before, if you istall the .net hooks then it should work for you. Hope that helps. Ben
Hi, Thanx for the reply, I'm not too sure with the whole hooks concept. But correct me if I am wrong, If I reinstall Office/Repair the installation I don't have to do anything else??? If so I'll give it a shot and let u know! Oh ja, one thing I forgot to mention is that only the events raises an error, I put them in a try/catch block and the failed of cause but the word document still opened... Make any sense? -- modified at 10:58 Thursday 26th July, 2007
-
Hi, Thanx for the reply, I'm not too sure with the whole hooks concept. But correct me if I am wrong, If I reinstall Office/Repair the installation I don't have to do anything else??? If so I'll give it a shot and let u know! Oh ja, one thing I forgot to mention is that only the events raises an error, I put them in a try/catch block and the failed of cause but the word document still opened... Make any sense? -- modified at 10:58 Thursday 26th July, 2007