Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-02-2023, 02:02 AM
JamesMWood JamesMWood is offline Reverse collection items? Windows 10 Reverse collection items? Office 2021
Novice
Reverse collection items?
 
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
 

Tags
collection, reverse



Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook vba - setting reference to subfolder, sometimes no folder items in collection travb81 Outlook 4 08-15-2023 04:07 AM
Looping backwards through a 'For Each' collection ThinAirDesigns Project 1 05-02-2019 02:16 PM
Deleting items in folders doesnt send them to deleted items! marshy365 Outlook 0 07-29-2016 03:19 AM
site collection is inaccurate dbsoccer51 Misc 0 12-02-2015 03:30 PM
Outlook 2007 Saved sent items list only holds the last ten items david.peake Outlook 0 06-01-2010 07:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft