select all navigationfolders in a navigationgroup

S

sd

hello

I need to select(check) all the navigationfolders in a
navigationgroup.I'm using below code -

For Each NavigationGrp In

CurrentExplorer.NavigationPane.Modules.GetNavigationModule
(Outlook.OlNavigationModuleType.olModuleCalendar).NavigationGroups

If String.Compare(strLocation, NavigationGrp.Name, True) = 0
Then 'strLocation= user selected Navigation group
For Each fld As Outlook.NavigationFolder In
NavigationGrp.NavigationFolders
fld.Folder.Views.Item("Day/Week/Month").Apply()
fld.IsSelected = True
Next
blnFound = True
Exit For
End If
Next

Though for each folder IsSelected property is set true,only the last
navigationfolder in the NavigationFolders collection

gets selected.Debugging shows the prop set to true for all
NavigationFolders but in outlook only last navigationfolder

retains the selection.What am I missing?

It is VSTO add in for OL 2007
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top