CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    Please Help - Trying to launch a program within VB...

    I am writing an application that should launch an instance of another windows application, say Microsoft WORD. I have been able to launch the program from my code outside of the application, but I am trying to launch it within the application itself... in a control of some sort. Is this possible?? If it is, can someone help??

    Thanks,
    Ron


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Please Help - Trying to launch a program within VB...

    'this sample will launch notepad.exe and wait until user closes it to continue execution

    Function MyFunc()
    Dim myObject As Object
    Dim RetVal As Variant

    Set myObject = CreateObject("WScript.Shell")
    RetVal = myObject.Run("c:\windows\notepad.exe", 1, True)
    MsgBox "Notepad is closed"

    End Function


    'TRue - wait until proc is over
    'False don't wait

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    Re: Please Help - Trying to launch a program within VB...

    Can this parameter be added for other applications as well? I am actually trying to launch another Windows application. What extactly is the WScript.shell??


  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Please Help - Trying to launch a program within VB...

    You can use it for any window application. WSShell is a window script host object. If you need you can find info in Microsoft knowledgebase

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured