I get a lot of questions asking how to delete the default folders, such as Junk Email, RSS, Conversation History, Archive, and Suggested Contacts. Microsoft Outlook creates these folders in the default data files. While I don't recommend deleting the default folders, anyone who really wants to delete default folders can delete them using MFCMAPI or OutlookSpy.
You can rename the defaults folders using the method at Rename default folders.
Deleting folders using these tools is usually not permanent: at some point in the future, Outlook may decide to recreate the folder. It may be weeks, it may be months, but it often comes back. Exactly how long it stays gone depends on the folder, Outlook recreates some folders fairly quickly.
PowerShell script to hide folders is here. A macro to hide folders is at the end of this article. Add it to the QAT to easily re-hide folders when Outlook unhides them. To hide a number of folders at once, in all data files, see Hide Extra Folders in Outlook.com
In most cases, it's better to hide the folder. Outlook seems less inclined to remove the Hidden tag from the folder (although lately it is removing the hidden tag from calendar folders within a couple of hours.). However, hiding a folder does not stop Outlook from using it. If you hide Junk email, RSS, or Suggested Contacts folders, you need to disable the features that use those folders.
Before using MFCMAPI or OutlookSpy, you should make a copy of your data file! While these steps are safe to use, it is very easy to have an "Oops, did I do that?" moment and lose your data.
Which folders are candidates for deletion or hiding? Junk Mail (only if its disabled first), RSS and Suggested Contacts (after disabling it in File, Options, Contacts).
Using scanpst or the /resetfolder switch may recreate the folders.
To use either method, get MFCMAPI. You'll need the 32-bit version if you use Outlook 2007, or Outlook 2010 and up in 32 bit. The 64-bit version is for use with Outlook 64-bit (NOT 64-bit Windows).
These instructions remove or hide default folders in a PST file. The process is similar with Exchange mailboxes, however, the missing folders are more likely to be recreated and removing them is not recommended.
Delete the Folder
- After downloading MFCMAPI, unzip it then double click to run.
- Click Session > Logon and choose your profile (if you have more than one)
- Double click on your data file. If you have more than one data file, the top one should be your default. (It will have True in the Default Store column.)
- Expand Root Container (or Root - Mailbox if using Exchange)
- Expand Top of Outlook Store. Exchange users will choose IPM_SUBTREE
- Select the folder you wish to delete.
- Right click and choose Delete Folder.
- Click OK. (Don't tick Hard Deletion, it doesn't work on most folders.)
- Close the dialogs and return to Outlook.
Hide the Folder
The macro at the end of this article automates these steps to hide the selected folder. If you accidentally hide the wrong folder, you'll need to use MFCMAPI to unhide it. Find the Hidden property and remove the tick from the Boolean field.
- After downloading MFCMAPI, unzip it then double click to run.
- Click Session > Logon and choose your profile (if you have more than one)
- Double click on your data file. If you have more than one data file, the top one should be your default. (It will have True in the Default Store column.)
- Expand Root Container (or Root - Mailbox)
- Expand Top of Outlook Store (or IPM_SUBTREE)
- Select Quick Step Settings folder
- Select "PR_ATTR_HIDDEN, PidTagAttributeHidden, ptagAttrHidden" entry (near the top)
- Right click and choose Copy Property
- Select the folder you wish to hide.
- Right click and choose Paste...
- Click OK twice to add the property to the folder.
- Close the dialogs and return to Outlook.
This screenshot shows the PR_ATTR_HIDDEN, PidTagAttributeHidden, ptagAttrHidden property added to the folder's property as well as the folder list without the Suggested Contacts folder (deleted) and Junk mail folder (hidden).
Use OutlookSpy
You can hide folders using OutlookSpy in 5 clicks:
- Select the Clutter folder
- Click IMAPIFolder button on the OutlookSpy ribbon
- Click “Add Property” button
- Type PR_ATTR_HIDDEN in the tag edit box and true in the value edit box
- Click OK
Restore a hidden folder
If you hid a folder and now need to unhide, you'll need to use MFCMAPI or OutlookSpy to remove the hidden folder. (If you are using Exchange cached mode and the folder appears in OWA, you can delete the ost file to restore the folder.)
- Open MFCMAPI.
- Go to Session, Logon.
- Double-click on the email account then Tools, Options and select “Use the MDB_ONLINE flag when calling OpenMsgStore”.
- Close then reopen the dialog box and Expand ‘Root Container’
- Expand “Top of Information Store”.
- Click on folder you need to unhide then Double-click “PR_ATTR_Hidden…” attribute.
- Check “Boolean” then OK
- If using Exchange or Office 365, verify that OWA did not display the folder.
- Then uncheck ‘Boolean’ and click OK to hide again. Check OWA.
- Start Outlook.
Manually Add the Property Tag using MFCMAPI
While it's easier for many people to copy and paste the property tag or use the macro, you can add the Hidden property tag to any folder using MFCMAPI.
- Get the property tag (0x10F4000B)
- Open MFCMAPI to the folder you want to hide
- Right-click an choose Edit Given Property
- Type or Paste the property into the Property name field and click Ok.
- Click Boolean then click OK to finish.
Tools
Utility hide unused folders in Outlook data files, include RSS, Calendar and Contacts in other .pst files. | |
MFCMAPI uses Microsoft's published APIs to provide access to MAPI stores through a graphical user interface. Its purpose is to facilitate investigation of Exchange and Outlook issues and to provide developers with a canonical sample for MAPI development. Updated frequently. |
Use PowerShell to Hide or Unhide a Folder
This PowerShell sample will hide or show a folder.
$Outlook = New-Object -comobject Outlook.Application $ns = $Outlook.GetNameSpace("MAPI") $PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" #hide the selected folder #$Folder =($Outlook.ActiveExplorer()).CurrentFolder #hide or unhide a default folder (Journal in this case) $Folder = $ns.GetDefaultFolder(11) # hide or unhide a folder at the same level as the inbox #$Folder = $ns.GetDefaultFolder(6).Parent.Folders.Item(".Test") # hide or unhide a subfolder of inbox #$Folder = $ns.GetDefaultFolder(6).Folders.Item(".Test") write-host $($Folder.Name) $oPA = $Folder.PropertyAccessor $value = $oPA.GetProperty($PropName) write-host $Indent$($Folder.Name)" ("$($Folder.Items.Count)")" $value # true = hidden, false = visible # check to see if hidden and change to visible If ($value -eq $true) { write-host "changing prop" $oPA.SetProperty($PropName, $false) } $value = $oPA.GetProperty($PropName) write-host $Indent$($Folder.Name)" ("$($Folder.Items.Count)")" $value
Hide Calendar and Contacts folders in Shared Mailboxes
This version of the script hides the Calendar or Contacts folders in Exchange shared Mailboxes. To get a list of mailboxes it will apply to before running the script, remove or comment out this line.
$oPA.SetProperty($PropName, $true)
$Outlook = New-Object -comobject Outlook.Application $ns = $Outlook.GetNameSpace("MAPI") $PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" #Get all shared mailboxes $mailboxes = $Outlook.GetNameSpace('MAPI').Stores | Where-Object {$_.ExchangeStoreType -eq 1} #$mailboxes | Select DisplayName, SmtpAddress foreach ($mailbox in $mailboxes) { $mailboxname = $mailbox.displayname write-host $mailboxname $store=$ns.Stores.Item($mailboxname) #calendar = 9, contacts = 10 $HideFolder = $store.GetDefaultFolder(9) write-host $($HideFolder.parent.Name) $oPA = $HideFolder.PropertyAccessor $value = $oPA.GetProperty($PropName) # true = hidden, false = visible # check to see if hidden and change to visible If ($value -eq $false) { write-host "changing prop" $oPA.SetProperty($PropName, $true) } $value = $oPA.GetProperty($PropName) }
Valid ExchangeStoreType Enumeration values:
ExchangeStoreType | Value | Description |
---|---|---|
olAdditionalExchangeMailbox | 4 | Specifies an additional Exchange mailbox store. |
olExchangeMailbox | 1 | Specifies an Exchange delegate mailbox store. |
olExchangePublicFolder | 2 | Specifies an Exchange Public Folder store. |
olNotExchange | 3 | Specifies that the store is not an Exchange store. |
olPrimaryExchangeMailbox | 0 | Specifies a primary Exchange mailbox store. |
Using PowerShell Scripts
To use PowerShell scripts with Outlook, start typing PowerShell on the start menu and open Windows PowerShell when it comes up. Windows PowerShell ISE has a script pane at the top, which is useful if you want to edit the script.
Paste the entire script in the PowerShell window and press Enter or the Run button if using PowerShell ISE.
Note: PowerShell scripts will not work with the Windows Store version of Office. You'll need to use a VBA macro version if you have the Windows store version of Office installed.
Saving PowerShell Scripts
If you want to save the script as a .ps1 file, paste it into Notepad and save it with the extension .ps1. To open it in the PowerShell IDE, type powershell on the start menu and click on Windows PowerShell IDE when the PowerShell app is found. Paste the script in the editing window.
To use it, you need to allow local scripts by running this command:
Set-ExecutionPolicy RemoteSigned
To run your saved .ps1 file, right-click on the script and choose Run with PowerShell.
Default Folder Enumeration Values
Name | Value | Description |
---|---|---|
olFolderCalendar | 9 | Calendar folder |
olFolderConflicts | 19 | Conflicts folder. (Business Exchange server only) |
olFolderContacts | 10 | Contacts folder |
olFolderDeletedItems | 3 | Deleted Items folder |
olFolderDrafts | 16 | Drafts folder |
olFolderInbox | 6 | Inbox folder |
olFolderJournal | 11 | Journal folder |
olFolderJunk | 23 | Junk E-Mail folder |
olFolderLocalFailures | 21 | Local Failures folder. (Business Exchange server only) |
olFolderManagedEmail | 29 | Top-level folder in Managed Folders group. (Business Exchange server only) |
olFolderNotes | 12 | Notes folder |
olFolderOutbox | 4 | Outbox folder |
olFolderSentMail | 5 | Sent Mail folder |
olFolderServerFailures | 22 | Server Failures folder. (Business Exchange server only) |
olFolderSuggestedContacts | 30 | Suggested Contacts folder |
olFolderSyncIssues | 20 | Sync Issues folder. (Business Exchange server only) |
olFolderTasks | 13 | Tasks folder |
olFolderToDo | 28 | To Do folder |
olPublicFoldersAllPublicFolders | 18 | All Public Folders folder in Exchange Public Folders. (Business Exchange server only) |
olFolderRssFeeds | 25 | RSS Feeds folder |
Use VBA to Hide Folders
To use this macro, paste it into the VBA editor, select the folder you want to hide and run the macro. If you need help using the VB Editor, see How to use the VBA Editor for more information and screenshots.
Option Explicit Public Sub HideFolders() Dim oFolder As Outlook.Folder Dim oPA As Outlook.propertyAccessor Dim PropName, Value, FolderType As String PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" Value = True Set oFolder = Application.ActiveExplorer.CurrentFolder Set oPA = oFolder.propertyAccessor oPA.SetProperty PropName, Value Set oFolder = Nothing Set oPA = Nothing End Sub
To unhide a folder, change
Set oFolder = Application.ActiveExplorer.CurrentFolder
to use a specific folder and change the Value line to False.
For example, if you accidently hid the Calendar, you'll use this for the oFolder line to unhide it.
Set oFolder = Session.GetDefaultFolder(olFolderCalendar)
More information on folder paths and other default folder names is available in the following article:
Working with All Items in a Folder or Selected Items
Option Explicit Public Sub UnHideFolders() Dim oFolder As Outlook.Folder Dim oPA As Outlook.propertyAccessor Dim PropName, Value As String PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" Value = False ' for default folder: Set oFolder = Session.GetDefaultFolder(olFolderCalendar) ' for subfolder you created: ' Set oFolder = Session.GetDefaultFolder(olFolderInbox).Folders("folder name") ' for a folder at the same level as the inbox: ' Set oFolder = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("folder name") Set oPA = oFolder.propertyAccessor oPA.SetProperty PropName, Value Set oFolder = Nothing Set oPA = Nothing End Sub
Unhide folder in a secondary mailbox
You need to use the GetFolderPath function from https://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/#GetFolderPath
To use, enter the account name and folder you need to unide.
Set oFolder = GetFolderPath("mailbox name\Deleted Items")
Public Sub ShowHiddenFolder() Dim oFolder As Outlook.Folder Dim oPA As Outlook.PropertyAccessor Dim PropName, Value As String PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" Value = False Set oFolder = GetFolderPath("mailbox name\Deleted Items") Set oPA = oFolder.PropertyAccessor oPA.SetProperty PropName, Value Set oFolder = Nothing Set oPA = Nothing End Sub
If you accidentally hid a folder and can't recall which folder it was, use this macro to create a list of folder names and the Hidden property value.
This macro is based on the macro at Print a list of your Outlook folders
To use, select the root of the data file you want to check and run the GetFolderHiddenState macro.
When finished, the macro creates a new email message containing all of the folders as shown in the very small sample below.
\\account name\Inbox - 5075 items. Is Hidden: False \\account name\Inbox\Test - 9 items. Is Hidden: False \\account name\Sync Issues\Server Failures - 0 items. Is Hidden: none \\account name\Contacts\Recipient Cache - 1206 items. Is Hidden: True \\account name\Need Replies\test - 2 items. Is Hidden: False
Warning: the list will contain a lot of folders you never knew existed. These are folders Outlook uses to store information it needs to work correctly, do not unhide them. "Is Hidden: none" means the folder does not have the Hidden property.
Public strFolders As String Public Sub GetFolderHiddenState() Dim olApp As Outlook.Application Dim olSession As Outlook.NameSpace Dim olStartFolder As Outlook.MAPIFolder Dim lCountOfFound As Long lCountOfFound = 0 Set olApp = New Outlook.Application Set olSession = olApp.GetNamespace("MAPI") ' Allow the user to pick the folder in which to start the search. Set olStartFolder = olSession.PickFolder ' Check to make sure user didn't cancel PickFolder dialog. If Not (olStartFolder Is Nothing) Then ' Start the search process. ProcessFolder olStartFolder End If ' Create a new mail message with the folder list inserted Set ListFolders = Application.CreateItem(olMailItem) ListFolders.Body = strFolders ListFolders.Display ' clear the string so you can run it on another folder strFolders = "" End Sub Sub ProcessFolder(CurrentFolder As Outlook.MAPIFolder) Dim i As Long Dim olNewFolder As Outlook.MAPIFolder Dim olTempFolder As Outlook.MAPIFolder Dim olTempFolderPath As String Dim oPA As Outlook.propertyAccessor Dim PropName, value, FolderType As String ' Loop through the items in the current folder. For i = CurrentFolder.Folders.count To 1 Step -1 Set olTempFolder = CurrentFolder.Folders(i) olTempFolderPath = olTempFolder.FolderPath ' Get the count of items in the folder olCount = olTempFolder.Items.count 'prints the folder path and name in the VB Editor's Immediate window Debug.Print olTempFolderPath & " " & olCount & " " & value ' Get the Hidden property value: PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B" Set oPA = olTempFolder.propertyAccessor On Error Resume Next value = oPA.GetProperty(PropName) ' if the property does not exist: If value = "" Then value = "none" ' create the string strFolders = strFolders & vbCrLf & olTempFolderPath & " Contains " & olCount & " items. Is Hidden: " & value lCountOfFound = lCountOfFound + 1 Next ' Loop through and search each subfolder of the current folder. For Each olNewFolder In CurrentFolder.Folders ProcessFolder olNewFolder Next End Sub
How to use macros
First: You will need macro security set to low during testing.
To check your macro security in Outlook 2010 and up, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.
After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Open the VBA Editor by pressing Alt+F11 on your keyboard.
To put the code in a module:
- Right click on Project1 and choose Insert > Module
- Copy and paste the macro into the new module.
More information as well as screenshots are at How to use the VBA Editor
More Information
Discussion in TechNet forum
How to disable Outlook's Junk Email folder
This did not work for me because I could not find either PR_ATTR-HIDDEN or IPM_SUBTREE while in MFCMAPI
What type of email account do you have in classic Outlook? Did you expand the folders and find the inbox and other default folders?
I have used the VBA code above in a slightly adapted form to create a sub that can be called with two arguments: one to pass an Outlook folder object and the other to pass a boolean value for either hiding (TRUE) or showing (FALSE) the specified Outlook folder.
I have also created a Function that takes an Outlook Folder object as argument and returns the current hidden status of the specified folder as a boolean value. It uses the GetProperty method on the PropertyAccessor to retrieve the current setting of the hidden property.
The function seems to work fine as long as it is used on a folder that has previously been hidden and/or unhidden with the SetProperty method of the PropertyAccessor.
Am I therefore correct to assume that the "Hidden" property ("http://schemas.microsoft.com/mapi/proptag/0x10F4000B") does not actually exist for any specific folder until the SetProperty method is used on that specific folder?
Correct, its not used on 'normal' folders - that's why you need to copy and paste from a hidden folder instead of just changing the value.
Hi,
The VBA code directly under the heading "Use VBA to Hide Folders" for hiding/showing Outlook folders includes a Dim statement for a string variable named "FolderType". However, this variable does not seem to be used anywhere in the rest of the code, or am I missing something?
You're correct. The code was repropused from another macro where it was used. Sorry.
I don't think this works in the new version of Outlook, at least with the MFCMapi program. When you right click and paste, nothing happens. The PR_ATTR_HIDDEN property of the folder i'm trying to hide (Archive) never changes from False to True. The box you show that pops up and then you're supposed to click Ok twice as you instruct, never happens. I'm using MFCMAPI.x64.exe.23.0.23089.01, and outlook version is 1.2023.1018.300
This is new Outlook: 1.2023.1018.300
This does not work with NEW OUTLOOK, only with the classic Outlook. It works in all versions of classic Outlook - these are the ones with year or 365 in their name and have a version number in this format: 16.0.12345.12345
Thank you Diane for sharing your expertise.
This works great, and yes, will remove anything, including subfolders of Public Folders; and subfolders of the Favorites of the Public Folders.
Not so great, is I inadvertently ran the script not meaning to. :-(
So, I unintentionally hid a subfolder called "Watch Items" that was in the Favorites folder.
The "Watch Items" subfolder is still showing in the "Public Folders" and works there, but does not show in Favorites.
(There are about 115 subfolders in Public Folders, so a nuisance to have to scroll thru to find what you want, Favorites is a good feature).
Going to Public Folders and 're-adding' "Watch Items" to Favorites does not cause it to show.
Oh, and yes, we are fully closing, then restarting Outlook 2016 each time.
What modification to the 'unhide' script to find the correct hierarchy and etc?
It is a terminal session (HP ThinPro/Citrix) Outlook 2016 on MSserver 2012R2 , MSExchange, on Outlook365
We can only use VBA. powershell, etc is not available.
We welcome your suggestions for repair.
Thank you.
Thanks for your great instructions, Diane!
In my Outlook, I have two accounts configured:
So there are two different mailboxes.
Following your VBA instructions, I could hide some default folders using VBA in both mailboxes. But now I want to unhide a default folder in the shared mailbox shared@mail.com.
I used your suggested code from above.
This works totally fine for the first mailbox account / inbox chipy@mail.com, but I can't get it to work for the second account / shared mailbox shared@mail.com.
How do I have to change the above code to unhide folders in the second account / shared mailbox?
Thanks in advance for your support!
A somehow desperate Chipy
Worked for me with Mapi 64 bits to delete unneeded folders in an imported pst files. Thanks!
Hi Diane,
Trying to use MFCMapix64.exe to hide folders in Outlook; Notes and Tasks. Unfortunately I cannot set the hide attribute. I can copy from the Quick Step Settings, but it does not give me the ability to paste (grayed out). If I try the manual steps, I can create it, but after I click 'ok', it does not add it. Any insight?
Thank you
Hello Eric, I had exactly the same problem.
The solution for me was to downgrade MFCMapi.exe version to v21.2.21062.01 :)