Results 1 to 3 of 3

Thread: Opening a .mtw file through VB **Resolved**

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2003
    Location
    Del
    Posts
    29

    Opening a .mtw file through VB **Resolved**

    Hi,

    I want to open a .mtw file through VB.

    Here is a scenario:
    When I double click on the .mtw throgh windows explorer the files gets opened in Minitab application. What I want to do is when I click a button in VB I want to open the same fil in minitab application.

    What I have done is I tried to do this along with Shell command, but the problem I faced is that to open a file with shell I need to provide .mtp file. Where as I don't have .mpt files.

    Can any one help me how can I replicate the same windows explorer functionality in VB.

    Your help is appriciated.

    Regards
    Rahman
    Last edited by rahmanji; Jan 15th, 2004 at 05:51 AM.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Use shellExecute api
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Option Explicit
    2.  
    3.  
    4. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    5.                 (ByVal hwnd As Long, ByVal lpszOp As String, _
    6.                  ByVal lpszFile As String, ByVal lpszParams As String, _
    7.                  ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    8.                  As Long
    9.  
    10. Private Sub Command1_Click()
    11.     'Open a web page
    12.     Dim l As Long
    13.     l = ShellExecute(Me.hwnd, "Open", "C:\somfile.mtw", "", "C:\", vbNormalFocus)
    14. End Sub
    -= a peet post =-

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