Results 1 to 2 of 2

Thread: Pro's Only - Enter Here

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258

    Wink Pro's Only - Enter Here

    How do i check if word is already open and if its open get a automation handle that works the same as
    set wrd = getobject("word.application") Etc

    And if my program crashes hwo can i get word shold close if i opened it with getobject.

    Really app any help

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Private Sub Command1_Click()
        Dim rc As Long, objWord As Object
        rc = FindWindow("OpusApp", vbNullString)
        If rc Then MsgBox "The window handle is " & rc: Exit Sub
        
        Set objWord = CreateObject("Word.Application")
        objWord.Visible = True
    End Sub
    ***Just realized, you wanted the automation handle.
    Last edited by Lethal; May 18th, 2001 at 05:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width