I have category data and for each category we have seperate expression which we are storing in a variable like expr_compCategory(1 to N) (i.e. expr_compCategory1 , expr_compCategory2 etc) and for each expression we have specific flag like flag_compCategory(1 to N)(i.e. flag_compCategory1,flag_compCategory2,flag_compCategory3 etc). So my requirement is like whatever Category is selected for that we have set the value 1 on the corresponding flag_compCategory.
set compSelection = ActiveDocument.fields("COMP_CATEGORY").GetSelectedValues
set compId= ActiveDocument.fields("COMP_CATEGORY_ID").GetPossibleValues
set vComp = compId.Item(i).Number
for i = 0 to varNo
for j=0 to compId.Count - 1
If Left(ActiveDocument.GetVariableDescriptions.Item(i).Name,10) = "flag_CompC" then 'and right(ActiveDocument.GetVariableDescriptions.Item(i).Name,1) = vComp then
set objTempVar = ActiveDocument.GetVariableDescriptions.Item(i)