GetObject

Heike

Well-known member
Joined
Jun 5, 2002
Messages
56
Help!!!!!!!

Until Friday everything worked fine. Today, nothing seems to work.

Im using GetObject:
Code:
    Dim objWordInstance As Word.Application

    objWordInstance = GetObject(, "Word.Application")

Unfortunately after this objWordInstance is nothing even if I can see, that there is an instance of word. What might be wrong???
 
i just did a test and works fine here , maybe you could look for instances of its process, then try the getobject. also you should really be casting the word.application from the object. eg:
Code:
        Dim wordApp As Word.ApplicationClass
        Dim p As Process() = Process.GetProcessesByName("WINWORD")
        If Not p.Length = 0 Then
            Dim objWord As Object = GetObject(, "Word.Application")
            wordApp = DirectCast(objWord, Word.ApplicationClass)
            /// word application found and can be manipulated now.
        Else
            /// no word app found running.
        End If
 
Back
Top