WD: Multiple Selections from a WordBasic Dialog ListBox

Last reviewed: February 2, 1998
Article ID: Q60872
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0
  • Word for the Macintosh, versions 6.0, 6.0.1

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 : macword winword2 word6 word7 word95 kbmacro
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
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.