2 Replies Latest reply: Mar 12, 2014 11:11 PM by jagan mohan rao appala RSS

    How to remove a field in a multibox, using a macro ?

      Hi

       

      I have a field in the document, by the name Market (with data M1,M2 and M3). I have a multibox with fields A, B and C(for each of the markets present in the field called, Market).

      Once the document is reloaded and reduced, based upon the values present in the Market field, the fields in the multibox should be removed.i.e, if after reduction, the Market field does'nt have the value, M3 - the field called C should be removed from the multibox, as well.

      So far, i could get upto here: But I do not want to make these selections inside macro - is there any other way ??

       

      sub macrocode

       

           set mb =  ActiveDocument.GetSheetObject("MB01") //fetch multibox id

                set f1 = ActiveDocument.Fields("Market").Select "M1"

                     if f1 <> 1 //if it cant find a value M1 in the field, Market

                          mb.RemoveField 0    //removing the corresponding field(say A) from the multbox (making sure that A is the first field in the multibox)

                     end if

                else

                //Same condition as above for a different market....so on