WD: Multiple Selections from a WordBasic Dialog ListBox

ID: Q60872

The information in this article applies to:

SYMPTOMS

Custom dialogs boxes created in the Microsoft Word macro language, WordBasic, do not allow multiple selections from a combo box or list box. Only a single item can be selected from a dialog list box or combo box.

CAUSE

In order to allow for multiple selections, you can use a group of check boxes. Check boxes are independent in that you can choose any number of check boxes within a dialog.

RESOLUTION

Word 6.x, 7.x

If you're using Word 6.0, you can create a dynamic dialog box with two side-by-side list boxes and a button that copies the selected item from the left list box to the right list box. The BatchConversion macro in the CONVERT.DOT file includes an example of this technique (CONVERT.DOT is located in the \WinWord\Macros directory).

Word 2.x

The following Word for Windows 2.0 macro uses eight independent CheckBox statements to allow for multiple selections.

   Sub MAIN
      Begin Dialog UserDialog 400, 196, "Microsoft Word"
      OKButton 282, 130, 88, 21
      CancelButton 282, 158, 88, 21
      GroupBox 10, 16, 344, 108, "Group Box"
      CheckBox 28, 33, 111, 16, "Check 1", .CheckBox1
      CheckBox 28, 52, 111, 16, "Check 2", .CheckBox2
      CheckBox 28, 69, 111, 16, "Check 3", .CheckBox3
      CheckBox 28, 86, 111, 16, "Check 4", .CheckBox4
      CheckBox 182, 33, 111, 16, "Check 5", .CheckBox5
      CheckBox 182, 52, 111, 16, "Check 6", .CheckBox6
      CheckBox 182, 69, 111, 16, "Check 7", .CheckBox7
      CheckBox 182, 86, 111, 16, "Check 8", .CheckBox8
      End Dialog
      Dim dlg As UserDialog
      n = Dialog(dlg)
   End Sub

Additional query words: list box combo dialog
Keywords          : kbmacro macword word6 winword2 word7 word95 
Version           : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.6.0.1a
Platform          : MACINTOSH Win95 WINDOWS winnt
Issue type        : kbprb

Last Reviewed: February 3, 1998