如何用VB打开当前目录下的txt
2013-10-19
展开全部
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 Const SW_SHOWNORMAL As Long = 1
Private Const SW_HIDE As Long = 0
Private Sub Command1_Click()
Dim TxtPath As String
TxtPath = App.Path & "\s5.txt"
Call ShellExecute(Me.hWnd, "Open", TxtPath, vbNullString, App.Path, SW_SHOWNORMAL)
End Sub
"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 Const SW_SHOWNORMAL As Long = 1
Private Const SW_HIDE As Long = 0
Private Sub Command1_Click()
Dim TxtPath As String
TxtPath = App.Path & "\s5.txt"
Call ShellExecute(Me.hWnd, "Open", TxtPath, vbNullString, App.Path, SW_SHOWNORMAL)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询