List Limits

H

Helmut Weber

Hi Ed,

for a listbox on a userform:

Private Sub CommandButton1_Click()
Dim l As Long
On Error GoTo ende
For l = 1 To 10000000
ListBox1.AddItem Format(l, "0000000000")
Next
ende:
MsgBox l ' 123512 here an now
End Sub

For a formfield of type wdFieldFormDropDown,
I think, it is 25.

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
D

Doug Robbins - Word MVP

Assuming that you mean a listbox and not a dropdown formfield (as used in a
document protected for forms, the practical limit will almost certainly take
precedence. As a test, I used the initialize event of a userform to load
2,185 records each with 31 fields from an table in an Access database into a
List Box on a userform.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

Ed

Other than a practical limit, is there a 'legal' limit to how many items
may be presented in a drop down or other Word list via VBA?

Thanks,

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top