可不可以写程序自动提取outlook中的附件?
有没有人做过?或是知道怎么实现
[解决办法]
N年前做过,MSMAPI有个叫GetAttachment的方法,可以取附件。
[解决办法]
保存OutLook收件夾中的附件
Funxtion SaveAttachFile()
On Error Resume Next
Dim myolapp As New Outlook.Application
Set fs = CreateObject( "Scripting.FileSystemObject ")
If Not fs.FolderExists( "c:\Mail ") Then fs.CreateFolder ( "c:\Mail ")
Set myNameSpace = myolapp.GetNamespace( "MAPI ")
Set myfolder = myNameSpace.GetDefaultFolder(olFolderInbox)
For i = 1 To myfolder.Items.Count
Set mymailitem = myfolder.Items(i)
With mymailitem
Set myAttachments = mymailitem.Attachments
para = myAttachments.Item(1).DisplayName
myAttachments.Item(1).SaveAsFile "c:\Mail\ " + _
IIf(IsNull(myAttachments.Item(1).DisplayName), i, myAttachments.Item(1).DisplayName)
End With
Next
MsgBox "附件保存完畢,請到目錄中中查看 ", vbDefaultButton1, "提示 "
End Sub