返回列表 上一主題 發帖

[發問] mailenvelope寄邮件

[發問] mailenvelope寄邮件

请问知不知道mailenvelope寄邮件可不可以加附件?
lmh

回復 3# mhl9mhl9


你這個 code 我之前有試過了
我的不行
我剛右去試一次
發現之所以不行是因為
正在執行中途我按了 Esc 鍵
而且一旦按了  Esc 鍵中途停止後

這個 code 再次重新執行再也不會成功
vba 一直說 error  error 的

TOP

回復 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秒!(不帶附件的)
lmh

TOP

沒辦法, outlook 就可以

TOP

        靜思自在 : 欣賞別人就是莊嚴自己。
返回列表 上一主題