Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
rml rml is offline
external usenet poster
 
Posts: 8
Default Drop down list box limt

I have a word doc that has a drop down list box. I'm trying to put more than
25 entries and it will not allow more than 25. Is that really the limit?
Does a work around exist?

Thanks.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 171
Default Drop down list box limt

That is really the limit.

Yes.

Word has a limit of 25 entries in a formfield dropdownbox. Microsoft
has an
article in the KnowledgeBase with a workaround for this limitation:
194026
How to Create a Combo Box Containing More Than 25 Items


Here's a snip of this article:

This article describes how to create and use a UserForm Combo box as an

Entry macro for a text form field. This macro can be used as a
workaround
for the 25-item limitation in drop-down form fields.


Create the User Form Combo Box
------------------------------
1. On the Tools menu, point to Macro and then click Visual Basic
Editor.
2. In the Project Window, select your TemplateProject.
NOTE: If the Project window does not show, click Project Explorer on
the
View menu.
3. On the Insert menu, click UserForm. A new UserForm and the Controls
Toolbox should now show. Right-click the UserForm and then click
View
Code on the shortcut menu. Add the following code


Private Sub UserForm_Initialize()
ComboBox1.ColumnCount = 1
'Load MyArray
MyArray(0) = "Zero"
MyArray(1) = "One"
MyArray(2) = "Two"
MyArray(3) = "Three"
'Load data into ComboBox
ComboBox1.List() = MyArray
End Sub


and then close the code window.


NOTE: MyArray() can contain as many (or few) items as you need. The
array is not limited to 25 items like the Drop-Down Form Field.
Right-click the UserForm and then click Properties on the shortcut
menu.
On the Alphabetic tab, rename (Name) to frmcombo and then rename
Caption
to Microsoft Word. Close the UserForm Properties window.


4. On the Controls tab of the Toolbox, select ComboBox and place it on
your
User Form. Right-click the ComboBox control and then click View Code
on
the shortcut menu. Change the ComboBox code to


Private Sub ComboBox1_Change()
ActiveDocument.FormFields("Text1").Result = ComboBox1.Value
End Sub


and then close the code window.
NOTE: Text1 is the bookmark name of the Text Form Field that you
will
insert into your template in step 2 of the "Create the Text Form
Field"
procedure of this article.


5. On the Controls tab of the Toolbox, select the CommandButton and
place
it on your User Form as a Close button. Right-click the
CommandButton
and then click View Code on the shortcut menu. Change the
CommandButton
code to


Private Sub Cmdclose_Click()
End
End Sub


and then close the code window. Right-click the CommandButton and
click
Properties on the shortcut menu. On the Alphabetic tab, rename
(Name) to
Cmdclose and then rename Caption to Close. Close the CommandButton
Properties window.


The UserForm Combo box is now complete. Proceed to the "Create the
Entry
Macro" procedure to create the Entry macro.


Create the Entry Macro
----------------------


1. In the Project Window, select your TemplateProject.


2. On the Insert menu, click Module. A blank module code sheet will be
displayed.


3. Type in the following code:


Dim MyArray(3)
Sub gocombobox()
frmcombo.Show
End Sub


NOTE: Make sure the DIM MyArray() statement contains the highest
array
number of the items contained in your array (not the total number of

array items) from step 3 of the "Create the User Form Combo Box"
procedure listed earlier in this article. For example, if you add a
fifth item (MyArray(4) = "Four") to the example array in step 3 of
the
"Create the User Form Combo Box" procedure, make sure you change the

DIM MyArray(3) statement to DIM MyArray(4).


The Exit macro is now complete. On the File menu, click Close and
Return to
Microsoft Word.


Create the Text Form Field
--------------------------


1. In your template, on the View menu, point to Toolbars and then click

Forms.


2. Position your insertion point where you want the result of the drop
down
list inserted. On the Forms toolbar, click Text Form Field (the
first
button on the left). The Text Form Field will be inserted into your
template as Grey shading.


NOTE: If you see the {FORMTEXT} field, press ALT+F9 to toggle the
field
codes off.


3. Right-click the Text Form Field and then click Properties on the
shortcut menu.


4. In the Text Form Field Options dialog box, under the Run macro on
section, click the down arrow in the Entry box and select the
gocombobox
macro.


NOTE: Make sure the Bookmark name of your Text Form Field is the
same as
you specified in step 4 of the "Create the User Form Combo Box"
procedure earlier in this article.


5. On the Forms toolbar, click Protect Form.


6. Save and close your template.


To use your template, click New on the File menu. Select your template
and
then click OK. A new document based on your template will be shown. The

UserForm containing the ComboBox with your items will be displayed when
you
tab into the Text Form Field.


rml wrote:
I have a word doc that has a drop down list box. I'm trying to put more than
25 entries and it will not allow more than 25. Is that really the limit?
Does a work around exist?

Thanks.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
rml rml is offline
external usenet poster
 
Posts: 8
Default Drop down list box limt

That worked great. One small problem. When I open the word doc, the
userform with the dropdown pops up and I have to close it? Any Ideas? It
seems to load when the doc opens.

Thanks.

"Greg Maxey" wrote:

That is really the limit.

Yes.

Word has a limit of 25 entries in a formfield dropdownbox. Microsoft
has an
article in the KnowledgeBase with a workaround for this limitation:
194026
How to Create a Combo Box Containing More Than 25 Items


Here's a snip of this article:

This article describes how to create and use a UserForm Combo box as an

Entry macro for a text form field. This macro can be used as a
workaround
for the 25-item limitation in drop-down form fields.


Create the User Form Combo Box
------------------------------
1. On the Tools menu, point to Macro and then click Visual Basic
Editor.
2. In the Project Window, select your TemplateProject.
NOTE: If the Project window does not show, click Project Explorer on
the
View menu.
3. On the Insert menu, click UserForm. A new UserForm and the Controls
Toolbox should now show. Right-click the UserForm and then click
View
Code on the shortcut menu. Add the following code


Private Sub UserForm_Initialize()
ComboBox1.ColumnCount = 1
'Load MyArray
MyArray(0) = "Zero"
MyArray(1) = "One"
MyArray(2) = "Two"
MyArray(3) = "Three"
'Load data into ComboBox
ComboBox1.List() = MyArray
End Sub


and then close the code window.


NOTE: MyArray() can contain as many (or few) items as you need. The
array is not limited to 25 items like the Drop-Down Form Field.
Right-click the UserForm and then click Properties on the shortcut
menu.
On the Alphabetic tab, rename (Name) to frmcombo and then rename
Caption
to Microsoft Word. Close the UserForm Properties window.


4. On the Controls tab of the Toolbox, select ComboBox and place it on
your
User Form. Right-click the ComboBox control and then click View Code
on
the shortcut menu. Change the ComboBox code to


Private Sub ComboBox1_Change()
ActiveDocument.FormFields("Text1").Result = ComboBox1.Value
End Sub


and then close the code window.
NOTE: Text1 is the bookmark name of the Text Form Field that you
will
insert into your template in step 2 of the "Create the Text Form
Field"
procedure of this article.


5. On the Controls tab of the Toolbox, select the CommandButton and
place
it on your User Form as a Close button. Right-click the
CommandButton
and then click View Code on the shortcut menu. Change the
CommandButton
code to


Private Sub Cmdclose_Click()
End
End Sub


and then close the code window. Right-click the CommandButton and
click
Properties on the shortcut menu. On the Alphabetic tab, rename
(Name) to
Cmdclose and then rename Caption to Close. Close the CommandButton
Properties window.


The UserForm Combo box is now complete. Proceed to the "Create the
Entry
Macro" procedure to create the Entry macro.


Create the Entry Macro
----------------------


1. In the Project Window, select your TemplateProject.


2. On the Insert menu, click Module. A blank module code sheet will be
displayed.


3. Type in the following code:


Dim MyArray(3)
Sub gocombobox()
frmcombo.Show
End Sub


NOTE: Make sure the DIM MyArray() statement contains the highest
array
number of the items contained in your array (not the total number of

array items) from step 3 of the "Create the User Form Combo Box"
procedure listed earlier in this article. For example, if you add a
fifth item (MyArray(4) = "Four") to the example array in step 3 of
the
"Create the User Form Combo Box" procedure, make sure you change the

DIM MyArray(3) statement to DIM MyArray(4).


The Exit macro is now complete. On the File menu, click Close and
Return to
Microsoft Word.


Create the Text Form Field
--------------------------


1. In your template, on the View menu, point to Toolbars and then click

Forms.


2. Position your insertion point where you want the result of the drop
down
list inserted. On the Forms toolbar, click Text Form Field (the
first
button on the left). The Text Form Field will be inserted into your
template as Grey shading.


NOTE: If you see the {FORMTEXT} field, press ALT+F9 to toggle the
field
codes off.


3. Right-click the Text Form Field and then click Properties on the
shortcut menu.


4. In the Text Form Field Options dialog box, under the Run macro on
section, click the down arrow in the Entry box and select the
gocombobox
macro.


NOTE: Make sure the Bookmark name of your Text Form Field is the
same as
you specified in step 4 of the "Create the User Form Combo Box"
procedure earlier in this article.


5. On the Forms toolbar, click Protect Form.


6. Save and close your template.


To use your template, click New on the File menu. Select your template
and
then click OK. A new document based on your template will be shown. The

UserForm containing the ComboBox with your items will be displayed when
you
tab into the Text Form Field.


rml wrote:
I have a word doc that has a drop down list box. I'm trying to put more than
25 entries and it will not allow more than 25. Is that really the limit?
Does a work around exist?

Thanks.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ampersand in Drop List Divelucaya Microsoft Word Help 1 July 10th 06 12:44 AM
Conditional Drop down list?? [email protected] Microsoft Word Help 3 January 16th 06 08:36 PM
Drop down list from another drop down list in Word? gobonniego Microsoft Word Help 1 December 20th 05 07:46 PM
check box and drop down list disappear Martine Microsoft Word Help 4 November 20th 05 09:07 PM
How do I create a drop down list in a form using Word? Donna New Users 3 June 21st 05 04:37 PM


All times are GMT +1. The time now is 08:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"