Microsoft KB Archive/60872

{|
 * width="100%"|

WD: Multiple Selections from a WordBasic Dialog ListBox

 * }

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, version 7.0
 * Microsoft 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.

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, &quot;Microsoft Word&quot; OKButton 282, 130, 88, 21 CancelButton 282, 158, 88, 21 GroupBox 10, 16, 344, 108, &quot;Group Box&quot; CheckBox 28, 33, 111, 16, &quot;Check 1&quot;, .CheckBox1 CheckBox 28, 52, 111, 16, &quot;Check 2&quot;, .CheckBox2 CheckBox 28, 69, 111, 16, &quot;Check 3&quot;, .CheckBox3 CheckBox 28, 86, 111, 16, &quot;Check 4&quot;, .CheckBox4 CheckBox 182, 33, 111, 16, &quot;Check 5&quot;, .CheckBox5 CheckBox 182, 52, 111, 16, &quot;Check 6&quot;, .CheckBox6 CheckBox 182, 69, 111, 16, &quot;Check 7&quot;, .CheckBox7 CheckBox 182, 86, 111, 16, &quot;Check 8&quot;, .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

Issue type : kbprb

Technology :