View Single Post
  #1  
Old July 27th 09, 02:52 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default select all navigationfolders in a navigationgroup

hello

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

For Each NavigationGrp In

CurrentExplorer.NavigationPane.Modules.GetNavigati onModule
(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
Ads