Yay !! This is just what I had been waiting for. What amazes me is how simple the code is to achieve this. It works perfectly. Well done, and many thanks !
Is there a way to highlight in the table of contents the heading that is showing at the top of the screen? That would further improve navigation and being able to see whereabouts one is in a long document.