VBA to Collapse Task Folder Groups

bkper087

Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
I am familiar with VBA, but most of my VBA experience is with Access. I would like to write VBA Code to collapse or expand all Task folder groups. This works with the tasks themselves using the native option under View - Expand/Collapse; however, it does not expand or collapse the sidebar groups of forms. Can anyone help me get started with the code?



Outlook.jpg
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You;ll use .NavigationGroups:
Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)

I don't have ready-to-use code that works on the tasks - only calendar - but I'm not sure if we can collapse them using code.

Microsoft's articles are here:

My calendar sample is here -
 
Top