Results 1 to 5 of 5

Thread: Opening another Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    9

    Post

    I want to open an external application such as MS Word when a user clicks on a control button. Does anyone have some code that would help please???

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    Look in the help for the Shell command - you use this to run external applications.

    eg;

    X=Shell("winword.exe",1)

    should run Microsoft Word.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Post

    You can also use the ShellExecute API if you want to open a specific file.

    Wade

  4. #4
    Lively Member
    Join Date
    Feb 2000
    Posts
    81

    Post

    Private Sub Command1_Click()
    Dim shellProgram As String
    Dim res
    shellProgram = "C:\WINWORD.EXE"
    res = Shell(shellProgram, vbNormalFocus) End Sub


  5. #5
    Member
    Join Date
    Feb 2000
    Posts
    43

    Post

    unless Winword.exe is installed to the root directory (C:\) that won't work.

    You'll need to specify the exact path of WINWORD.EXE (or using just Winword.exe should work since Windows can probably find it)...

    ------------------
    Rapmaster

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