|
楼主 |
发表于 2009-2-19 22:20
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub CommandButton1_Click()
Dim objOL As Object
Dim itmNewMail As Object
Dim i
i = 3
Do While Cells(i, 3) <> ""
Set objOL = CreateObject("Outlook.Application")
Set itmNewMail = objOL.CreateItem(olMailItem)
With itmNewMail
.Subject = Cells(i, 4)
.Body = Cells(i, 3)
.to = Cells(i, 2)
.Attachments.Add "R:\1.txt "
.Display
.Send
End With
On Error GoTo continue
continue:
On Error GoTo 0
Set itmNewMail = Nothing
Set objOL = Nothing
i = i + 1
Loop
End Sub
加重装office |
|