VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 1560
Left = 1485
TabIndex = 0
Top = 600
Width = 1545
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'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 LongPrivate Sub SendMail(Optional Address As String, _
Optional Subject As String, Optional Body As String, _
Optional CC As String, Optional BCC As String) Dim strCommand As String
'Build up the mail string
If Len(Subject) Then strCommand = "&Subject=" & Subject
If Len(Body) Then strCommand = strCommand & "&Body=" & Body
If Len(CC) Then strCommand = strCommand & "&CC=" & CC
If Len(BCC) Then strCommand = strCommand & "&BCC=" & BCC
'Replace the first ampersand, if any,
'with a question
If Len(strCommand) Then
Mid(strCommand, 1, 1) = "?"
End If
'Add mailto: command and main e-mail
'address to the command string
strCommand = "mailto:" & Address & strCommand
'Execute command via the API
Call ShellExecute(Form1.hwnd, "open", strCommand, _
vbNullString, vbNullString, SW_SHOWNORMAL)End SubPrivate Sub Command1_Click()
Dim aaa As String
Dim bbb As String
Dim ccc As String
Dim ddd As String
Dim eee As String
aaa = "aa"
bbb = "bbb"
ccc = "ccc"
ddd = "ddd"
eee = "eee" SendMail aaa, bbb, ccc, ddd, eee
MsgBox aaa
MsgBox bbb
MsgBox ccc
MsgBox ddd
MsgBox eee
MsgBox xx
End Sub
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 1560
Left = 1485
TabIndex = 0
Top = 600
Width = 1545
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'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 LongPrivate Sub SendMail(Optional Address As String, _
Optional Subject As String, Optional Body As String, _
Optional CC As String, Optional BCC As String) Dim strCommand As String
'Build up the mail string
If Len(Subject) Then strCommand = "&Subject=" & Subject
If Len(Body) Then strCommand = strCommand & "&Body=" & Body
If Len(CC) Then strCommand = strCommand & "&CC=" & CC
If Len(BCC) Then strCommand = strCommand & "&BCC=" & BCC
'Replace the first ampersand, if any,
'with a question
If Len(strCommand) Then
Mid(strCommand, 1, 1) = "?"
End If
'Add mailto: command and main e-mail
'address to the command string
strCommand = "mailto:" & Address & strCommand
'Execute command via the API
Call ShellExecute(Form1.hwnd, "open", strCommand, _
vbNullString, vbNullString, SW_SHOWNORMAL)End SubPrivate Sub Command1_Click()
Dim aaa As String
Dim bbb As String
Dim ccc As String
Dim ddd As String
Dim eee As String
aaa = "aa"
bbb = "bbb"
ccc = "ccc"
ddd = "ddd"
eee = "eee" SendMail aaa, bbb, ccc, ddd, eee
MsgBox aaa
MsgBox bbb
MsgBox ccc
MsgBox ddd
MsgBox eee
MsgBox xx
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货