博客园 首页 联系 管理
Sub Send(Subject As String, Body As String, SendTo As String)
Dim OlApp As New Outlook.Application
Dim mail As Outlook.MailItem
    
    Set mail = myOlApp.CreateItem(olMailItem)
    mail.To = SendTo
    mail.Subject = Subject
    mail.HTMLBody = Body
    mail.Send
End Sub

Sub SendFromCell()
Dim sh As Worksheet
Set sh = ThisWorkbook.Worksheets("Sheet1")
Send sh.Cells(2, 1), sh.Cells(2, 2), sh.Cells(2, 3) & "@DoMainName"
End Sub
posted on 2012-09-21 14:42  CodeBlove  阅读(2190)  评论(0编辑  收藏  举报