Graham- I tried the code you supplied but i'm having the same problem. Whenever the code reaches the Sub_delete_header_first_row, it doesn't delete anything and it just jumps to the end and stops. it doesn't even run Removesectionbreaks or deleteemptyparas.
Just for my own understanding, How does the code know what odoc and otable are when they have not been set?
thanks for trying. i guess i'm not smart enough to figure this out.