N
Nigel RS
I am using the following code, that runs from an outlook rule, to save
attachments
to a path defined by the contents of the email body. For example in my
email body I have the text string
D:\
I receive an error despite the path and file looking OK.
Help!
Sub ANYPATH(itm As Outlook.MailItem)
Dim objatt As Outlook.Attachment
Dim SaveFolder As String
SaveFolder = Trim(itm.Body)
For Each objatt In itm.Attachments
objatt.SaveAsFile SaveFolder & objatt.DisplayName
Next
Set objatt = Nothing
End Sub
attachments
to a path defined by the contents of the email body. For example in my
email body I have the text string
D:\
I receive an error despite the path and file looking OK.
Help!
Sub ANYPATH(itm As Outlook.MailItem)
Dim objatt As Outlook.Attachment
Dim SaveFolder As String
SaveFolder = Trim(itm.Body)
For Each objatt In itm.Attachments
objatt.SaveAsFile SaveFolder & objatt.DisplayName
Next
Set objatt = Nothing
End Sub