Many years ago Microsoft added a feature to Outlook.com that gave users the opportunity to link various online contact sources, such as Gmail, Facebook, Twitter and others with Outlook.com accounts. This created additional contact folders in the mailbox, one for each linked service. This service is no longer available but, unfortunately, the folders remain in the mailbox. These folders are visible in both Outlook desktop and on smartphones but are hidden in Outlook on the web.
I’m starting to hear from users who have these empty contacts folders in Outlook but are unable to delete them. A few seconds after deleting the folder, it pops back into view in Outlook.
Microsoft is in the process of deleting the Skype contact folders, which should be completed in late 2018.
Deleting the folders in Outlook doesn't work; the folders pop back up within seconds.
The solution: hide the folders using MFCMAPI. I have instructions to do one folder at a time at How to Hide or Delete Outlook's Default Folders but if you have multiple accounts in your profile, each with some of these extra folder, it can take some time to hide all of the folders.
This version of the macro checks all mailboxes in the profile and hides any of the folders it finds. The code to search for the folders is from Michael Bauer at VBOffice.net, using bits of code from Find a Folder by its Name and Expand All Folders.
If you have other folders you want to hide, add the folder name to the array, comma separated and wrapped in quotes. The macro will work with any folder (but Outlook may unhide the folder later).
arrFolder = Array("Skype Contacts", "People You May Know on Skype", "SkypeEnabled Contacts", "Facebook Contacts", "Linkedin Contacts", "google contacts", "twitter contacts", "Yahoo Contacts")
Hide Folders Macro
Private m_Folder As Outlook.MAPIFolder Private m_Find As String Private Const SpeedUp As Boolean = True Public Sub HideFolders() Dim Name$ Dim Folders As Outlook.Folders Set m_Folder = Nothing m_Find = "" Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("Mapi") Dim strFolder As String Dim arrFolder As Variant ' Set up the array arrFolder = Array("Skype Contacts", "People You May Know on Skype", "SkypeEnabled Contacts", "Facebook Contacts", "Linkedin Contacts", "google contacts", "twitter contacts", "Yahoo Contacts") ' Go through the array and look for a match, then do something For i = LBound(arrFolder) To UBound(arrFolder) m_Find = arrFolder(i) m_Find = LCase$(m_Find) m_Find = Replace(m_Find, "%", "*") Set Folders = Application.Session.Folders LoopFolders Ns.Folders, True Next i End Sub Private Sub LoopFolders(Folders As Outlook.Folders, ByVal bRecursive As Boolean) Dim F As Outlook.MAPIFolder Dim Found As Boolean 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 If SpeedUp = False Then DoEvents For Each F In Folders Found = (LCase$(F.Name) = m_Find) If Found Then Debug.Print F.Name Set oPA = F.PropertyAccessor oPA.SetProperty PropName, Value End If LoopFolders F.Folders, bRecursive If Not m_Folder Is Nothing Then Exit For Next End Sub
How to use the macros on this page
First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work with the top two options that disable all macros or unsigned macros. You could choose the option Notification for all macros, then accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the macro security to notify.
To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look 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.
The macros on this page should be placed in a module.
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