Also can I folder structure in Outlook start automatically expand to allow IMAP?
Many users wish that the IMAP mailbox (similar to the POP3 area in the folder list) to expand the folder are displayed. Unfortunately, Outlook shrugs shoulders here with the virtual. The VBA has this requirement:
Code:
Private Sub Application_Startup ()
Dim objFolder As Outlook.MAPIFolder
Dim As String strStartFolder
As Long Dim lngFolder
On Error Resume Next
'Startup folder set (eg Contacts, Inbox, Tasks, etc.)'
strStartFolder = "Outlook Today"
'Inbox folder Expand All'
For lngFolder = 1 To Outlook.Session.Folders.Count
Set objFolder = Outlook.Session.Folders (lngFolder). Folders ("Inbox")
Call Outlook.ActiveExplorer.SelectFolder (objFolder)
Next
'When the program starts select folder'
If strStartFolder = "Outlook Today" Then
Set objFolder = Outlook.Session.GetDefaultFolder (olFolderInbox). Parent
Else
Set objFolder = Outlook.Session.GetDefaultFolder (olFolderInbox). Parent.Folders (strStartFolder)
End If
Call Outlook.ActiveExplorer.SelectFolder (objFolder)
Set objFolder = Nothing
End Sub
And then you stop the macro:
- Then press (Alt) + (F11), the Visual Basic Editor.
- Double-click in the Project Explorer on the entry ThisOutlookSession, where you have saved the branches must show the parent, if necessary.
- In the code window, the above program lines:
- Quit the Visual Basic Editor and save the VBA project
- Run the macro using Tools -> Macro -> Macros
Bookmarks