|
7#
楼主 |
发表于 2014-8-9 22:22:05
|
只看该作者
Option Explicit
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 '首先利用API中的ShellExecute函数,使用此函数可打开任意后缀名的文件
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", "D:\123.txt", vbNullString, vbNullString, vbNormalFocus ‘具体打开指定目录的文件
End Sub
您说的是这个不?是不是应该用case 判断它的返回值,如果出错好给个反馈。 |
|