Results 1 to 2 of 2

Thread: Could you explain this to me?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2001
    Posts
    21

    Could you explain this to me?

    I am rather new to VB, so for me it's a bit hard to understand it sometimes. I have a code to check if Word is running:
    Function IsWordApp() As Boolean
    On Error GoTo PROC_WordCOPY
    Set mvarWordApp = GetObject(, "Word.Application")
    PROC_EXIT:
    mvarWordApp.Visible = True
    IsWordApp = True
    Exit Function
    PROC_WordCOPY:
    MsgBox "Word is running!"
    On Error GoTo PROC_NOWord
    Set mvarWordApp = New Word.Application 'here smth.'s wrong
    Resume PROC_EXIT
    PROC_NOWord:
    MsgBox "Word is not installed on this computer"
    IsWordApp = False
    End Function

    I don't understand how it checks if Word is running. As I see it, it will always be false. Could you explain, please? And what's the difference if I check different application?

    Roman.

  2. #2
    See your post in the General VB Questions forum http://forums.vb-world.net/forumdisp...p?s=&forumid=1

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