Results 1 to 2 of 2

Thread: opening a file with a program.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18

    Unhappy opening a file with a program.

    how could I open a file with a program, like if you open a *.txt file it automatically opens in notepad. is there a way of finding out this file's name?

    um, I've been having a lot of trouble with the vb-world website, so if you could e-mail your response to
    [email protected]
    I'd really appreciate it.

    And if anyone knows about changing user access levels in NT, I'd appreciate being told how. is there a MAKE_ADMIN api?

  2. #2
    Megatron
    Guest
    Use the ShellExecute function.
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    2.  
    3. Private Sub Command1_Click()
    4.  
    5.     ShellExecute hwnd, "open", "C:\MyFile.txt", "", "", 1
    6.  
    7. End Sub

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