-
Saving attatchments into different HDD directories
Hi,
Very new to this wonderful thing called VBA and am needing some help.
I'm trying to save attatchments into two different folders on my hdd.
One email I recieve has a *.csv file and the other email has a *pdf file. Both are from the same sender but have different subjects
I want one to go to c:/temp and the other to go to h:/temp
At the moment Im using this which is sending all files to the same directory. I dont know how to seperate.
[vba]
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "h:\temp"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
[/vba]
Any help would greatly be appriciated
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules