View Single Post
 
Old 02-02-2023, 02:02 AM
JamesMWood JamesMWood is offline Windows 10 Office 2021
Novice
 
Join Date: May 2022
Posts: 25
JamesMWood is on a distinguished road
Question Reverse collection items?

Hiya

Is there any way to reverse the order that attachments are reattached to my email? Excerpt:

If olItem.Attachments.Count > 0 Then
For i = olItem.Attachments.Count To 1 Step -1
olAtt = olItem.Attachments(i)
sName = olAtt.FileName
If sName Like "*.pdf" Then
sName = Replace(olAtt.FileName, "%20", " ") 'Removes %20 from file names
olAtt.SaveAsFile(sPath & sName)
cNames.Add(sPath & sName)
olAtt.Delete()
End If
Next i

For i = 0 To cNames.Count
olItem.Attachments.Add(cNames(i))
Kill(cNames(i))
Next i

End If
Reply With Quote