air1access
Technical User
I am working with some code that saves the attachments on selected emails...
It saves out the first attachment, and then the next attachment has the file name + a formatted date trailing on the name...
It does this because the attachments are all named the same thing.
I don't want it to name the files like that - I want it to save the first attachment, and for the rest, add 1 to the file name..
So -
savedattachment.csv
savedattachment_1.csv
savedattachment_2.csv
savedattachment_3.csv
And so on...
Below is what I am working on:
Do While objFSO.FileExists(strAtmtPath)
strAtmtNameTemp = strAtmtName(0) & _
Format(Now, "_mmddhhmmss") & _
Format(Timer * 1000 Mod 1000, "000") + 1[/b]
'CMS Daily New Seminar Reports_0223130204477
strAtmtPath = strFolderPath & strAtmtNameTemp & "." & strAtmtName(1)
' /* If the length of the saving path is over 260 characters.*/
If Len(strAtmtPath) > MAX_PATH Then
lCountEachItem = lCountEachItem - 1
' False: This attachment cannot be saved.
blnIsSave = False
Exit Do
End If
Loop
It saves out the first attachment, and then the next attachment has the file name + a formatted date trailing on the name...
It does this because the attachments are all named the same thing.
I don't want it to name the files like that - I want it to save the first attachment, and for the rest, add 1 to the file name..
So -
savedattachment.csv
savedattachment_1.csv
savedattachment_2.csv
savedattachment_3.csv
And so on...
Below is what I am working on:
Do While objFSO.FileExists(strAtmtPath)
strAtmtNameTemp = strAtmtName(0) & _
Format(Now, "_mmddhhmmss") & _
Format(Timer * 1000 Mod 1000, "000") + 1[/b]
'CMS Daily New Seminar Reports_0223130204477
strAtmtPath = strFolderPath & strAtmtNameTemp & "." & strAtmtName(1)
' /* If the length of the saving path is over 260 characters.*/
If Len(strAtmtPath) > MAX_PATH Then
lCountEachItem = lCountEachItem - 1
' False: This attachment cannot be saved.
blnIsSave = False
Exit Do
End If
Loop