After calling Clear, I was unable to add items again as I got a duplicate key error. I managed to overcome the problem by using ctlPopMenu.ClearSubMenusOfItem ("xxxx"), where "xxxx", "yyyy" and "zzzz" are the sub menus I previously created. I would have thought that ctlpopMenu.Clear would have done the same thing and cleared out the whole lot in one go, but apparently it does not. |