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 kumarPosted Jun 1, 2017, 9:17 AM
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);