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 LongSub opensomething(ByVal filepath As String) ShellExecute hwnd, "open", filepath, vbNullString, vbNullString, 5 End Sub'写到菜单项的CLICK事件中'打开网页:opensomething "http://community.csdn.net/Expert/topic/4720/4720759.xml?temp=.3265802" '打开帮助文件: opensomething "d:\abc.hlp"
ShellExecute hwnd, "open", filepath, vbNullString, vbNullString, 5
End Sub'写到菜单项的CLICK事件中'打开网页:opensomething "http://community.csdn.net/Expert/topic/4720/4720759.xml?temp=.3265802"
'打开帮助文件: opensomething "d:\abc.hlp"