Its in VBA
If cmbhlevels.Value = "1" Then
ActiveDocument.AttachedTemplate.AutoTextEntries("z_TOC1").Insert Where _
:=Selection.Range, RichText:=True
End If
If cmbhlevels.Value = "2" Then
ActiveDocument.AttachedTemplate.AutoTextEntries("z_TOC2").Insert Where _
:=Selection.Range, RichText:=True
End If

santosh kumarRank #6,510 · 264 reputationPosted Jun 1, 2017, 5:17 AM EDT
if(cmbhlevels.Value == "1")
ActiveDocument.AttachedTemplate.AutoTextEntries["z_TOC1"].Insert(Where:Selection.Range, RichText:True);
if(cmbhlevels.Value == "2")
ActiveDocument.AttachedTemplate.AutoTextEntries["z_TOC2"].Insert(Where:Selection.Range, RichText:True);