关于VBS的CDO组件批量处理.eml文件的一个低级问题
Dim objCDO, objMessage, objAtt, strPath, strAttPath, myRegon error resume Next
Set myReg=WScript.CreateObject("WScript.Shell")
strPath = myReg.CurrentDirectory & "\"
strAttPath = strPath & "Attachments\"
Set objCDO = CreateObject("CDO.DropDirectory")
For Each objMessage In objCDO.GetMessages(strPath)
For Each objAtt In objMessage.Attachments
dtmNowDate = Now()
dtmNowDate = Year(dtmNowDate) & right("0"&month(dtmNowDate),2) & right("0"& day(dtmNowDate),2)& right("0"& hour(dtmNowDate),2) & right("0"& minute(dtmNowDate),2) & right("0"& second(dtmNowDate),2)
objAtt.SaveToFile strAttPath & dtmNowDate & "_" & objAtt.Filename
Next
Next
Set objCDO = Nothing
Set objMessage = Nothing
Set objAtt = Nothing
Set myReg= nothing
Msgbox "OK, All of Attachments extract to " & strAttPath
______________________________________________________________
分割线以上是一段VBS,作用是批量提取.eml文件中的附件并单独保存为当前时间+附件名。
以上代码也是来自于互联网公开渠道
请大牛指导,如何在本段代码中获取.eml文件的完整文件名,并把提取出来的附件命名为.eml文件名+附件名的格式。
新人拜谢!