Automating download of emails in a STAR folder with connection to SAS (bridge)
Good afternoon, I am trying to automate a process and the beginning of all this is to download 8 csv files that are sent to me by email, I have seen that this can be done with outlook through rules with the following script:
Public Sub test3(item As Outlook.MailItem)
Dim object_attachment As Outlook.Attachment
Dim saveFolder As String
saveFolder = "J:\xxxxx\Semana\xxxx\xxxxx\"
For Each object_attachment In item.Attachments
If InStr(object_attachment.FileName, ".csv") Then
'If Int(object_attachment.ReceivedTime) = Date Then
object_attachment.SaveAsFile saveFolder & object_attachment.FileName
End If
'End If
Next
End Sub
The route, although you cannot see it, is directed to a Star folder, any file that is deposited in this folder, will be transferred directly to a SAS server, where this folder also exists, that is, if I leave an excel here, it disappears after 3 seconds because it is transferred to the copy of this folder but in SAS, it is a kind of bridge between the user and SAS.
A priori the script works perfectly, but when I do several tests and make it download some files in this path so that I can upload them directly to SAS, the STAR folder stops working and loses its bridging property. When I do several tests, the excels that I download stay there and the folder becomes useless, does anyone know if my rule is causing any interference with the functionality of said folder?
If so, could someone tell me how to fix it? or if there are other alternatives to download these files that come to me automatically by mail and pass them to SAS
Thank you very much in advance, greetings