if (cmbhlevels.Value == "1")
{
ActiveDocument.AttachedTemplate.AutoTextEntries("z_TOC1").Insert (Where: Selection.Range, RichText: true);
}
It looks like the original code is VBA though so it's unlikely to work as-is in an independent c# project as there is no concept of "ActiveDocument" etc.