OTWarrior
02-05-2009, 04:19 AM
One of my team has a load of subfolders he has created in the following format:
123456780 John Smith
123456788 Jane Jones
Since Outlook arranges it's folders alphabetically, he would like to change his folders to be in this format:
Jane Jones 123456788
John Smith 123456780
Since there are about 50 of these folders, I said I would probably be easier to make a macro for this (I know, I am a glutton for punishment ;)
So far I have been able to find the name of the current folder using the following code:
Sub DisplayCurrentFolderName()
Dim myOlApp As Outlook.Application
Dim myExplorer As Outlook.Explorer
Dim myFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
Set myFolder = myExplorer.CurrentFolder
MsgBox myFolder.Name
End Sub
I am fairly certain a loop and/or array is needed to do this, but I am uncertain how to move to the next folder within a subfolder of outlook.
Any help with this would be much appreciated.:thumb
123456780 John Smith
123456788 Jane Jones
Since Outlook arranges it's folders alphabetically, he would like to change his folders to be in this format:
Jane Jones 123456788
John Smith 123456780
Since there are about 50 of these folders, I said I would probably be easier to make a macro for this (I know, I am a glutton for punishment ;)
So far I have been able to find the name of the current folder using the following code:
Sub DisplayCurrentFolderName()
Dim myOlApp As Outlook.Application
Dim myExplorer As Outlook.Explorer
Dim myFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
Set myFolder = myExplorer.CurrentFolder
MsgBox myFolder.Name
End Sub
I am fairly certain a loop and/or array is needed to do this, but I am uncertain how to move to the next folder within a subfolder of outlook.
Any help with this would be much appreciated.:thumb