Thank you Andy that is really great. I can use the second bit to get the security on the templates :)
However, I do need to get the Security bit too, which tells you what permissions will be on a document that uses that template. I've checked some of the perm tables and cannot see where it is :( please help again? Thank you very much in advance.