把Outlook附件的图片批量存储下来
Sunday, 7. May 2006, 02:11:38

利用这段代码
把Outlook附件的内容全部保存下来

Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment
Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
Set strFolderpath = CreateObject("WScript.Shell")
For Each objAttachment In colAttachments
objAttachment.SaveAsFile (strFolderpath.SpecialFolders("MyDocuments") & "\" & objAttachment.FileName)
Next
Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing
End Sub
这里是保存到MyDocuments
如果要保存到Desktop的话
把这段代码
objAttachment.SaveAsFile (strFolderpath.SpecialFolders("MyDocuments")
中的MyDocuments修改为Desktop











