D.Moore
Senior Member
- Outlook version
- Outlook 2016 64 bit
- Email Account
- Office 365 Exchange
Hi!
May I ask your kind help with a problem I am struggling with:
I have couple hunders of mail fodlers in outlook, and I would like to create a VBA code, which:
0. Manually executed/run.
1. Pops up a Folder Pickup dialog, somethign like this:
Sub PickFolder()
Dim xNameSpace As NameSpace
Dim xPickFolder As Folder
Dim xExplorer As Explorer
On Error Resume Next
Set xNameSpace = Outlook.Application.Session
Set xPickFolder = xNameSpace.PickFolder
If TypeName(xPickFolder) = "Nothing" Then Exit Sub
Set xExplorer = Outlook.Application.ActiveExplorer
xExplorer.Close
Set xPickFolder = Nothing
Set xNameSpace = Nothing
End Sub
- The pick up folder would be the "root" folder for us.
2. After root folder selected, it picks up the first sub folder (level1) and set the its folder view to X, where is is the name of the folder view defined in Outlook selectable view settings.
- X name can be set in the code as many folder views exist.
3. After this first subfolder folder view set, it check is there is any sub-sub folder (level2) and set the its folder view to Y, where is is the name of the folder view defined in Outlook selectable view settings.
- It stops going any deeper, so it wont goo any deper then level 2.
- Y name can be set in the code as many folder views exist.
4. After this, it picks up the second subfolder (level 1) in root, and it going on until it is finished with the whole content of the selected (so NOT the complete PST,just the selected) root folder content.
BIG BIG thank you for your time and help,
Moore
May I ask your kind help with a problem I am struggling with:
I have couple hunders of mail fodlers in outlook, and I would like to create a VBA code, which:
0. Manually executed/run.
1. Pops up a Folder Pickup dialog, somethign like this:
Sub PickFolder()
Dim xNameSpace As NameSpace
Dim xPickFolder As Folder
Dim xExplorer As Explorer
On Error Resume Next
Set xNameSpace = Outlook.Application.Session
Set xPickFolder = xNameSpace.PickFolder
If TypeName(xPickFolder) = "Nothing" Then Exit Sub
Set xExplorer = Outlook.Application.ActiveExplorer
xExplorer.Close
Set xPickFolder = Nothing
Set xNameSpace = Nothing
End Sub
- The pick up folder would be the "root" folder for us.
2. After root folder selected, it picks up the first sub folder (level1) and set the its folder view to X, where is is the name of the folder view defined in Outlook selectable view settings.
- X name can be set in the code as many folder views exist.
3. After this first subfolder folder view set, it check is there is any sub-sub folder (level2) and set the its folder view to Y, where is is the name of the folder view defined in Outlook selectable view settings.
- It stops going any deeper, so it wont goo any deper then level 2.
- Y name can be set in the code as many folder views exist.
4. After this, it picks up the second subfolder (level 1) in root, and it going on until it is finished with the whole content of the selected (so NOT the complete PST,just the selected) root folder content.
BIG BIG thank you for your time and help,
Moore