改用 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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "open", "C:\aa.txt", "", App.Path, 1
End Sub
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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "open", "C:\aa.txt", "", App.Path, 1
End Sub
On Error Resume Next
Shell "start mailto:" & txtEmail
End Sub
Private Sub cmdElink_Click()
On Error Resume Next
Shell "start mailto:" & txtEmail
End Sub
ShellExecute Me.hwnd, "open", "mailto:[email protected]?subject=主题在这里&body=" & "内容在这里", "", App.Path, 1
End Sub
Shell "start.exe mailto:[email protected]?subject=主题在这里&body=" & "内容在这里", vbHide
End Sub
compile error:
Argument not optional用的语句是
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 LongPrivate Sub Command4_Click()
ShellExecute Me.hwnd, "open", "mailto:[email protected]?subject=主题在这里&body=" & "内容在这里", "", App.Path, 1
End Sub
ShellExecute地方我的语句是这样的:
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 LongPrivate Sub Command4_Click()
ShellExecute Me.hwnd, "open", "mailto:" & txtMail
End Sub