Solved! Go to Solution.
ESRI.ArcGIS.Framework.ITemplates templates = ArcMap.Application.Templates; System.Windows.Forms.MessageBox.Show(template.get_Item(template.Count - 1).ToString());
ESRI.ArcGIS.Framework.ITemplates templates = ArcMap.Application.Templates; System.Windows.Forms.MessageBox.Show(template.get_Item(template.Count - 1).ToString());