Skip navigation.

So Easy[@]Opera

原来如此简单

把Outlook附件的图片批量存储下来

, ,


利用这段代码
把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

LCD(液晶顯示器)我的Tag云の超感版

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31