Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-20-2017, 10:21 PM
gmayor's Avatar
gmayor gmayor is offline Any way to move multiple email folders? Windows 10 Any way to move multiple email folders? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You should be able to take the drudgery out of the task by using a simple macro to move the folders from one location to another using a simple loop (or loops if more than one pair of locations) e.g. to move all the folders from subfolder1 of Inbox to subfolder2 of inbox, the following will work. You just have to set the source and target folder locations appropriately.

Code:
Sub MoveFolders()
'Graham Mayor - http://www.gmayor.com - Last updated - 21 Aug 2017
Dim olSourceFolder As Folder
Dim olTargetFolder As Folder
Dim lngFldr As Long

    Set olSourceFolder = Session.GetDefaultFolder(olFolderInbox).folders("Subfoldername1")
    Set olTargetFolder = Session.GetDefaultFolder(olFolderInbox).folders("Subfoldername2")

    For lngFldr = olSourceFolder.folders.Count To 1 Step -1
        olSourceFolder.folders(lngFldr).MoveTo olTargetFolder
    Next lngFldr
lbl_Exit:
    Set olSourceFolder = Nothing
    Set olTargetFolder = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create multiple copies of same email in multiple folders gaker10 Outlook 0 10-06-2014 07:44 AM
Move Outlook folders from old HD to new HD Dennism Outlook 1 01-30-2012 11:51 AM
Any way to move multiple email folders? User cannot move email messages within Outlook Inbox folder and sub-folders. Darsss Outlook 5 06-06-2011 11:37 PM
Any way to move multiple email folders? trying to move pesonal folders to new computer mstruhs Outlook 1 02-24-2010 10:07 PM
How do I move file folders ..please? steve e Outlook 0 05-15-2008 10:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:07 PM.


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