|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
你好mineshine老师,同事的要求无止境,可惜我又水平有限,不得不再次请教您。。。
以下代码的邮件正文需要设置成为 Times Roman,14号字,并且在从excel表中选择的各个column用蓝色表示。
我用蓝色标出。
Sub AutoMail()
Dim OutlookApp As Object
Dim MailItem As Object
Dim Recipient As Object
Dim i As Integer
For i = 2 To Sheets("CFD").[A65536].End(xlUp).Row
Set OutlookApp = CreateObject("Outlook.Application")
Set MailItem = OutlookApp.CreateItem(0)
Set Recipient = MailItem.Recipients.Add(Sheets("CFD").Range("U" & i).Value)
MailItem.Subject = "This is auto Email From Kuehne & Nagel Ltd Guangzhou Office"
MailItem.Body = "致尊敬的经销商:" & vbNewLine & _
"Dear Dealer:" & vbNewLine & _
" " & vbNewLine & _
" " & vbNewLine & _
"xxxxxxx广州分公司,由xxxxxx广州配送中心" & vbNewLine & _
"委托,承运订单号为 (附件" & Sheets("CFD").Range("A" & i).Value & ")的零部件至(附件" & Sheets("CFD").Range("F" & i).Value & ")。" & vbNewLine & _
"如需查询该票货物的运输状态,请浏览xxxx司的网页http://www.abc.com/。" & vbNewLine & _
"您的查询号码为 (附件" & Sheets("CFD").Range("B" & i).Value & ")." & vbNewLine & _
" " & vbNewLine & _
"KN was authorized by Daimler Northeast Asia Parts Trading and Services Co., LTD" & vbNewLine & _
"Guangzhou PDC to deliver automotive parts under PO (" & Sheets("CFD").Range("A" & i).Value & ") to" & vbNewLine & _
"(" & Sheets("CFD").Range("F" & i).Value & ")." & vbNewLine & _
"Regarding the transportation status of mentioned shipment, please check on " & vbNewLine & _
"KN website http://www.kn-portal.com/. " & vbNewLine & _
"Your tracking number is (" & Sheets("CFD").Range("B" & i).Value & ")." & vbNewLine & _
" " & vbNewLine & _
" " & vbNewLine & _
"谢谢!" & vbNewLine & _
"Thanks for your attention!" & vbNewLine & _
" " & vbNewLine & _
" " & vbNewLine & _
"xxxxxxx广州分公司" & vbNewLine & _
"xxxxxxx Guangzhou Branch Office"
MailItem.Send
Set OutlookApp = Nothing
Set MailItem = Nothing
Set Recipient = Nothing
Next i
End Sub
好多个谢谢!!!! |
|