I am trying to use VBA to download an outlook attachment(csv file) with “RICHARDSON” in
The attachment name, and save it to C:\current_data\RICHARDSON.CSV.
I have this coding but I get user-defined type not defined.
![]()
Public Sub saveAttachtoDisk(itm As Outlook.MailItem) Dim attach As Outlook.Attachment Dim saveFolder As String Case InStr(.Filename, &"*RICHARDSON*"&) .SaveAsFile (C:\current_data\*&"*RICHARDSON"&*) Case Else End Sub
Bookmarks