Printing A List Of Outlook Folders
Posted by William Diaz on September 1, 2011
Besides taking screen shots of the Outlook navigation pane, there is no built in way to print or output to a file a list of folders. However, you can work around this by creating a macro in Outlook using the Visual Basic editor.
In Outlook 2010:
- Enable the Developer tab by going to the File tab > Customize Ribbon.
- Check the Developer option under the right column and click OK.
- The Developer tab is now part of the Outlook Ribbon.
- Select the Visual Basic button (or ALT+F11).
- Right-click the Module folder, then Insert > Module and name it.
- Copy and paste the code at the bottom of this post into the VBA Project window
or
Import the attached .bas file below by going to File > Import File - Run the macro by clicking the Macro button. There are two options available, ExportFoldernames and ExportFolderNamesSelect:
The first one exports the currently selected folder and the second one allows you to specify a folder (or the entire mailbox). You can choose to structure or not to structure the output and a text file will be written to the desktop named outlookfolders.txt.
In Outlook 2007:
- Go to Tools > Macro > Visual Basic Editor (or ALT+F11).
- Repeat steps 5 and 6 under the 2010 instructions (if you do not have a module folder, right-click Project1 instead)
- Run the macro from Tools > Macro > Macros… (or ALT+F8)
Alternatively, you can customize by adding the macro to an exiting toolbar or a new one.
In Outlook 2003:
- Go to Tools > Macro > Visual Basic Editor (or ALT+F11).
- Repeat steps 5 and 6 under the 2010 instructions (if you do not have a module folder, right-click Project1 instead)
- Run the macro from Tools > Macro > Macros… (or ALT+F8)
Alternatively, you can customize by adding the macro to an exiting toolbar or a new one.
Get the .bas import file along with a vbs file that can run outside of Outlook here:
Or copy and paste this into the VBA Project Window:
Private MyFile As String Private Structured As Boolean Private Base As Integer Public Sub ExportFolderNames() Set F = Application.ActiveExplorer.CurrentFolder Dim Result As Integer MyFile = GetDesktopFolder() & "\outlookfolders.txt" WriteToATextFile (StructuredFolderName(F.FolderPath, F.Name)) LoopFolders Folders Set F = Nothing Public Sub ExportFolderNamesSelect() Set F = Application.Session.PickFolder If Not F Is Nothing Then Dim Result As Integer MyFile = GetDesktopFolder() & "\outlookfolders.txt" WriteToATextFile (StructuredFolderName(F.FolderPath, F.Name)) LoopFolders Folders Set F = Nothing Private Function GetDesktopFolder() Private Sub LoopFolders(Folders As Outlook.Folders) For Each F In Folders Private Sub WriteToATextFile(OLKfoldername As String) Open MyFile For Append As #fnum Private Function StructuredFolderName(OLKfolderpath As String, OLKfoldername As String) As String Dim x As Integer StructuredFolderName = OLKprefix & OLKfoldername |
Change Outlook Contacts “File As” En Masse « Windows Explored said
[…] can work around this with a macro and a little bit of VBA. You may want to enable the Developer Ribbon before hand for Office 2007/2010. Once you have, create a new module or insert the code below into […]
Change Outlook Contacts “File As” En Masse « Windows Explored said
[…] You can work around this with a macro and a little bit of VBA. You may want to enable the Developer Ribbon before hand for Office 2007/2010. Once you have, create a new module or insert the code below into […]