- 帖子
- 214
- 主題
- 74
- 精華
- 0
- 積分
- 296
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office2007
- 閱讀權限
- 20
- 性別
- 男
- 來自
- hk
- 註冊時間
- 2013-6-17
- 最後登錄
- 2018-11-3
|
3#
發表於 2015-7-19 11:47
| 只看該作者
回復 2# jackyq
以下code可以加附件,而且能順利寄出:
Sub test5()
Application.DisplayAlerts = False
[a2:d5].Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "abcd"
.Item.To = "123@163.com"
.Item.Subject = "efgh"
.Item.Attachments.Add ThisWorkbook.Path & "/abc.xls"
' .Item.display
.Item.Send
End With
'begin closing the allocation file and save it
' Windows(Allocfile).Activate
Application.DisplayAlerts = True
End Sub
但問題是,每寄一次,附件abc.xls會累加,寄第五次,abc.xls就有5個.我想一定有辦法清除原來的附件.但不知道如何做.
為什麼用mailenvilope,因為它快,寄40封4秒!(不帶附件的) |
|