Hi
If you're using VBA then use:
Dim pProject As VBProject
Set pProject = ThisDocument.VBProject
Otherwise something like the following should work:
Application.Templates.Item(Application.Templates.Count - 1)
I've not tested this so might not be 100% accurate but should set you on your way.