按照昨天开心海的办法用  
Shell "rundll32.exe url.dll,FileProtocolHandler " & App.Path & "\SHELLTST.TXT" 
是可以调用已有的文本文件,但是为什么出来的文件没有获得当前焦点?并且屏幕全灰,象是死机一样?
请问如何让文本自动弹出?

解决方案 »

  1.   

    Shell "C:\WINNT\system32\notepad.exe e:\log.txt"用这个方法也可以打开文本文件。^_^
      

  2.   

    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
    Private Sub Command1_Click()ShellExecute Me.hWnd, vbNullString, App.Path & "\SHELLTST.TXT" 
    , vbNullString, vbNullString, 1End Sub
      

  3.   

    Shell "C:\WINNT\system32\notepad.exe e:\log.txt", vbNormalFocus用楼上的参数,更新。^_^
      

  4.   

    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
    Private Sub Command1_Click()
    ShellExecute hwnd, "open", "c:\FRUNLOG.TXT", "", "", 1
    End Sub