![]() WriteToATextFile (StructuredFolderName(F.FolderPath, F. Private Sub LoopFolders(Folders As Outlook.Folders) ![]() Set objShell = CreateObject("WScript.Shell") WriteToATextFile (StructuredFolderName(F.FolderPath, F.Name)) MyFile = GetDesktopFolder() & "\outlookfolders.txt"īase = Len(F.FolderPath) - Len(Replace(F.FolderPath, "\", "")) + 1 Result = MsgBox("Do you want to structure the output?", vbYesNo + vbDefaultButton2 + vbApplicationModal, "Output structuring") ' You can export the folder names with their full path ![]() ' names starting from the currently selected folder. 'Description: Outlook macro which allows you to export all folder You can use the code below for review or manual installation. The following code is contained in the zip-file referenced in the Quick Install. Add a button for easy access to the macro or press ALT+F8 and select the macro you want to execute.Īdd a button of the macro to the QAT for quick access to it.Sign your code so you won’t get any security prompts and the macro won’t get disabled.Click on the File Explorer’s address bar and type in cmd to open a Command Prompt. If you copied the code paste it into a new module. Follow the instructions below: Open your File Explorer and find the necessary folder. Extract the zip-file and import the ExportFolders.bas file via File-> Import….Open the VBA Editor (keyboard shortcut ALT+F11).Download this code-file ( exportoutlookfolders.zip) or copy the code below.Use the following instructions to configure the macro in Outlook This is mainly to accommodate for exporting folder lists of an entire IMAP mailbox store when using Outlook 2010 (as you can’t select the root folder in that version of Outlook). This macro does exactly the same as the ExportFolderNames with the exception that it will prompt you to select a starting folder. The module also contains a macro called ExportFolderNamesSelect. A folder that is for instance rooted 3 levels deep when compared to the start folder will have 3 hyphen characters in front of it. A hyphen character “-” will be placed in front of the folder name to indicate when a folder is a sub folder. ![]() If you choose “Yes”, only the folder names will be exported. If you choose “No” (default), the output will list all the folder names with their folder path in full. When executing the macro, you’ll be prompted whether or not you want to structure the output. The ExportFolderNames macro allows you to export all folder names starting from the currently selected folder. When you run ExportOutlookFolders.vbs again, your new results will be appended to the outlookfolders.txt file. You’re done! When you want to use the script from within Outlook instead feel free to continue reading -).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |