Private Sub Command2_Click()
Dim request As String
If RaceNo.Text = "" Then
MsgBox " 输入要查询随机排位的场次"
Exit Sub
Else
request = RaceNo.Text
Call Shell("Notepad.exe D:\newweb\&request&".txt", 1)
End If
End Sub
在模块中添加下列声明:
Public 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