none
VBS start Word 2007 error??? RRS feed

  • Question

  • I use bellow VBS to start Word2007, but failed

    a messagebox popup!

    an internal error occur

    8001ffff

    what's the problem?how to fix this?

     

    Set app = createobject("Word.application")
    
    
    Tuesday, March 8, 2011 8:02 AM

Answers

  • Hi,

    I have tested code in my machine and it worked fine in Windows Forms Application. The setup of my machine: Visual Studio 2010 and Office 2010. There are two ways to achieve it.

         1.
           Dim oApp As Microsoft.Office.Interop.Word.Application
           Dim oDoc As Microsoft.Office.Interop.Word.Document
           oApp = CreateObject("Word.Application")
           oDoc = oWord.Documents.Add
           oApp.Visible = True

         2.
        Dim oApp As New Word.Application
        Dim oDoc As Word.Document
        Set oDoc = oApp.Documents.Add
        oApp.Visible = True

     


    SeeSeaIng
    Wednesday, March 9, 2011 3:16 AM