Option Explicit '声明API函数用于异步打开一个文档 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 = 1 然后在过程中调用:private Sub CmdHelp_Click() dim a as long Dim b As String b = App.Path & "\help.chm" '用变量b记录与主程序同目录下的help.chm帮助文件 a = ShellExecute (0, "open", b, "", "", SW_SHOWNORMAL) End Sub
Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE www.google.com", vbMaximizedFocus
'声明API函数用于异步打开一个文档
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 = 1 然后在过程中调用:private Sub CmdHelp_Click()
dim a as long
Dim b As String
b = App.Path & "\help.chm" '用变量b记录与主程序同目录下的help.chm帮助文件
a = ShellExecute (0, "open", b, "", "", SW_SHOWNORMAL)
End Sub