Advertisement
| 09.29.2008 at 10:12AM PDT, ID: 23772115 | Points: 350 |
|
[x]
Attachment Details
|
||
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: 32: 33: 34: 35: 36: 37: |
Sub SaveAttachments()
Dim olkSelectedItems As Object, _
olkItem As Object, _
objFile As Object, _
objDict As Object, _
strFilename As String, _
arrLines As Variant, _
varName As Variant, _
varTemp As Variant
strFilename = ""
Set olkSelectedItems = Application.ActiveExplorer.Selection
For Each olkItem In olkSelectedItems
Set objDict = CreateObject("Scripting.Dictionary")
If olkItem.Attachments.Count > 0 Then
arrLines = Split(olkItem.Body, vbCrLf)
For Each varName In arrLines
varTemp = Trim(varName)
If Left(varTemp, 1) = "*" Then
If Not objDict.Exists(varTemp) Then
objDict.Add Mid(varTemp, 2), Mid(varTemp, 2)
End If
End If
Next
arrLines = objDict.Items()
For Each objFile In olkItem.Attachments
For Each varName In arrLines
strFilename = "c:\OutlookTemp\" & varName
objFile.SaveAsFile strFilename
Next
Next
End If
Next
Set objDict = Nothing
Set objFile = Nothing
Set olkItem = Nothing
Set olkSelectedItems = Nothing
End Sub
|
Advertisement