-2
Sub Mail_ActiveSheet()
' Works in Excel 2000, Excel 2002, Excel 2003, Excel 2007, Excel 2010, Outlook 2000, Outlook 2002, Outlook 2003, Outlook 2007, Outlook 2010
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim Cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim cc As String
Dim bcc As String
Dim Body As String
Dim Attment As String
Dim OutApp As Object
Dim OutMail As Object
Dim X As String
X = Range("B2").Select
Do Until ActiveCell = ""
company = ActiveCell
ActiveCell.Offset(0, 1).Range("A1").Select
i = ActiveCell
ActiveCell.Offset(0, 2).Range("A1").Select
cemail = ActiveCell
ActiveCell.Offset(1, -3).Range("A1").Select
EmailAddr = Range("L2")
cc = Range("M2")
bcc = Range("N2")
Subj = Range("O2")
Attment = Range("P2")
Body = "Dear All," & vbLf _
& vbLf _
& "Request you to present the ECS as per the below details & Pl confirm after submission of the data file. " & vbLf _
& vbLf _
& "CECS handover date :" & Range("I2") & vbLf _
& vbLf _
& "Settlement Date :" & Range("J2") & vbLf _
& vbLf _
& "Number of records :" & Range("F2") & vbLf _
& vbLf _
& "Total Contra Amount : " & Range("G2") & vbLf _
& vbLf _
& "Type of presentation : ECS Debit" & vbLf _
& vbLf _
& "Attachments : E-2 Form/Validation Reports/ECS data file" & vbLf _
& vbLf _
& "Thanks & Regards" & vbLf _
& vbLf _
& "GOBI L" & vbLf _
& "ING VYSYA BANK LTD | CECS | 100, EDEN PARK | 20 VITTAL MALLYA ROAD | BANGALORE-560001 | PH :080-22532127 | "
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set Sourcewb = ActiveWorkbook
Set Destwb = ActiveWorkbook
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = EmailAddr
.cc = cc
.bcc = bcc
.Subject = Subj
.Body = Body
.Attachments.Add (Attment)
.Display
End With
Loop
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
你有什麼試圖解決你的問題?你的代碼在哪裏失敗?負責迭代表單的部分在哪裏?你是什麼意思*'我需要爲下面的表格添加循環,這樣我就可以發送很多郵件在單獨的單獨的單獨的郵件中的孤立* *?你很不清楚,你沒有表現出解決你的問題的任何努力。我們不只是爲你寫代碼,你在一個錯誤的地方好友。見[如何問](http://stackoverflow.com/questions/how-to-ask) – 2013-07-24 07:43:40
你的問題是什麼?當你上次編輯你的帖子時,你提出了這個問題。 – PowerUser