4 Replies Latest reply: Feb 8, 2011 11:21 PM by Logesh Jayaraman RSS

    Multibox selection

    Logesh Jayaraman

      Hi,

      I need help on macro to get specific field selected value on the multibox. Can anyone help me on this.

       

        • Multibox selection
          Rakesh Mehta

          Hi XXX

          If your MultiBox has expressions, I don't think this is possible. If you have fields, you can make selection to the fields in the multibox, you are interested in.

          EDIT:

          On second thought, it seems this macro from APIGuide can help you:

           

          Sub GetSelected

          x=ActiveDocument.GetSheetObject("MB01").GetRelevantSelections

          for i = lbound(x) to ubound(x)

          msgbox(x(i))

          next

          End Sub


          • Multibox selection
            Rakesh Mehta

            Try this for just value portion:

             

            Sub GetS

             

            x=ActiveDocument.GetSheetObject("MB01").GetRelevantSelections



            for i = lbound(x) to ubound(x)

            msgbox(trim(mid(x(i), instr(x(i), chr(9))+1, 100)))

            next

            End Sub

            Please note that there is a TAB between field name and value in the return array.



            I have hard coded 100 for the value field length, but you may also use len() or some other function to be precise.