Infor LN (BaaN ERP)论坛

 找回密码
 加入Baan会员

QQ登录

只需一步,快速开始

QQ群一:61560730(已满)QQ群二:34342363
查看: 8326|回复: 1

excel宏,自动发mail

[复制链接]
发表于 2009-6-9 13:53:07 | 显示全部楼层 |阅读模式
Sub sendmail()

Dim mailtoname, mailaddress As String

Set myOlapp = CreateObject("Outlook.application")
  
    With Worksheets("Address")
        address_rows = .Range("a65536").End(xlUp).Row
        
        i = 2
        Do While i <= address_rows
            mailtoname = .Range("A" & i)
            mailaddress = .Range("B" & i)
            Set myMail = myOlapp.CreateItem(olMailItem)
            
            With myMail
            .To = mailaddress
            .Subject = "Auto send mail"
            .Body = "Hi " & mailtoname & ":" & vbCrLf & "    This is auto send mail , ..."
            .attachments.Add "D:\wo.txt"
   
            .Display
            .Send
            End With
            
        i = i + 1
        Set myMail = Nothing
        Loop
    End With
   
    Set myOlapp = Nothing
End Sub
发表于 2011-4-22 11:22:35 | 显示全部楼层
能不能给个可以有自动提醒功能的代码啊?呵呵~~~
您需要登录后才可以回帖 登录 | 加入Baan会员

本版积分规则

QQ|Archiver|手机版|小黑屋|Infor LN Baan论坛 沪ICP备20006045号-3

GMT+8, 2024-4-20 09:00 , Processed in 0.139653 second(s), 17 queries .

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表