Results 1 to 2 of 2

Thread: shell default application to open a file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    UK
    Posts
    205

    shell default application to open a file

    how do you shell a document instead of an application so that it opens with the default application for openiong files of that filetype. Basically what i a trying to do is shell a word document so it loads word or wordperfect. I cant be arsed to mess about with the registry anymore.

  2. #2
    jim mcnamara
    Guest
    Code:
    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
    Const SW_SHOWNORMAL = 1
    Private Sub Form_Load()
        ShellExecute Me.hwnd, vbNullString, _
        "c:\myfile.doc", vbNullString, "C:\", SW_SHOWNORMAL
    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