I wish to delete all the folders from the outlook favorites then subsequently replace them, but the delete doesn't seem to work. What's wrong with my code.
Setup Objects works fine
' Get the "Favorite Folders" navigation group Set favGroup = Application.ActiveExplorer.NavigationPane.Modules.GetNavigationModule(olModuleMail).NavigationGroups.GetDefaultNavigationGroup(olFavoriteFoldersGroup)
Set inboxFldr = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox) favGroup.NavigationFolders.Add (inboxFldr)
All this works except the .delete lines (which fail with the error "wrong number of arguments or invalid property assignment) - obviously I only want one delete line, but put both in to show the options I'd tried.
Debug.Print favGroup.NavigationFolders.count Set oFolder = Application.ActiveExplorer.CurrentFolder While favGroup.NavigationFolders.count > 0 favGroup(1).Delete favGroup.NavigationFolders(1).Delete Wend