Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Runtime error with MS Word

Runtime error with MS Word

Scheduled Pinned Locked Moved C#
databasehelpquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andre Stroebel
    wrote on last edited by
    #1

    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 ;)

    K 1 Reply Last reply
    0
    • A Andre Stroebel

      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 ;)

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • K kubben

        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

        A Offline
        A Offline
        Andre Stroebel
        wrote on last edited by
        #3

        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

        K 1 Reply Last reply
        0
        • A Andre Stroebel

          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

          K Offline
          K Offline
          kubben
          wrote on last edited by
          #4

          When you reinstall / fix office there is a new option that talks about add .net components. You should see that if office was installed before the .net framework. Ben

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups