|
以下是保存OUTLOOK所有附件的VBS代码,请问各位大师,如果只保存指定一封邮件的附件,改如何改动代码(虽然显得不实用,但本人急需)。
非常谢谢!
'----------------------------------------------------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set colItems = objFolder.Items
On error Resume Next
For Each objMessage in colItems
intCount = objMessage.Attachments.Count
If intCount > 0 Then
For i = 1 To intCount
objMessage.Attachments.Item(i).SaveAsFile "E:\KK\emai_lattachment\" & _
objMessage.Attachments.Item(i).FileName
Next
End If
Next
'----------------------------------------------------------------------- |
|