Imported IMAP folders: Outlook does not contain emails
3 December 2020During an exchange migration, we are often faced with IMAP mailboxes, when you have exported to a PST file once you open in Outlook, the folder will be empty “no mail visible”.
You will have the same behavior if you export your PST to a mailbox on Exchange online, or when you want to consult it from your smartphone.
This guide contains a script that you can run to apply the fix automatically
The Folder Class property is set to IPF.Imap instead of IPF.Note .
This has various side effects, visual issues, and functionality issues such as:
- You do not have monitoring indicators such as: Today, Tomorrow, This week, etc., for these imported cases.
- You will see a âFilter appliedâ message in the lower left corner of the status bar.
- When you switch to the View tab and press the Change View button, you will see views specific to IMAP accounts.
- Folders are not visible when you sign in to your mailbox through Exchange ActiveSync on your smartphone or tablet.
Solution
The script below will fix the wrong folder class property for you to revert to a normal mail folder just like everyone else.
After running the script, you will immediately see all of your emails again, have tracking flag support, and all other issues mentioned above will be gone.
You don’t even need to restart Outlook!
The script allows you to fix a single folder, a folder and its subfolders or your entire mailbox at a time.
It will automatically recognize files that do not require correction and will not make any changes to them either.
- Open a text editor and paste the following script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
Dim i Call FolderSelect() Public Sub FolderSelect() Dim objOutlook Set objOutlook = CreateObject("Outlook.Application") Dim F, Folders Set F = objOutlook.Session.PickFolder If Not F Is Nothing Then Dim Result Result = MsgBox("Do you want to include the subfolders?", vbYesNo+vbDefaultButton2+vbApplicationModal, "Include Subfolders") i = 0 FixIMAPFolder(F) If Result = 6 Then Set Folders = F.Folders LoopFolders Folders End If Result = MsgBox("Done!" & vbNewLine & i & " folder(s) have been fixed.", vbInfo, "Fix Imported IMAP Folders") Set F = Nothing Set Folders = Nothing Set objOutlook = Nothing End If End Sub Private Sub LoopFolders(Folders) Dim F For Each F In Folders FixIMAPFolder(F) LoopFolders F.Folders Next End Sub Private Sub FixIMAPFolder(F) Dim oPA, PropName, Value, FolderType PropName = "http://schemas.microsoft.com/mapi/proptag/0x3613001E" Value = "IPF.Note" On Error Resume Next Set oPA = F.PropertyAccessor FolderType = oPA.GetProperty(PropName) 'MsgBox (F.Name & " - " & FolderType) If FolderType = "IPF.Imap" Then oPA.SetProperty PropName, Value i = i + 1 End If Set oPA = Nothing End Sub |
- Save your document by replacing the extension .txt in .vbs
- Run your script
- Click Outlook on the taskbar to display the “Select Folder” dialog box.
- Select the folder you want to correct and press OK.
- You will now receive a prompt indicating whether you want to include the subfolders as well. If you don’t see this prompt, click the script icon on your taskbar.
- When the script is complete, you will receive a notification indicating the number of cases fixed.
- The contents of all folders should now be visible again and you should no longer have an IMAP view or any of the other issues mentioned above.
Views: 2396