The way I do this sort of thing is to have the entries for the combobox in
the first column of a table in a document that I use as the source, with one
entry per row, and the entries for the listbox that correspond to each item
in the combobox as individual paragraphs in the cell in the second column of
the table on the same row. Then I use code such as the following in the
change event of the combobox
Private Sub CmbCompany_Change()
' This code populates the SalesRep combo with the relevant sales reps
based on the company
' that has been selected.
CmbSalesRep.Clear
Dim sourcedoc As Document, i As Long, myitem As Range
' Modify the path in the following line so that it matches where you saved
Suppliers.doc
Set sourcedoc = Documents.Open(FileName:="d:\worddocs\Suppliers.doc")
For i = 1 To sourcedoc.Tables(1).Cell(CmbCompany.ListIndex + 2,
2).Range.Paragraphs.Count
Set myitem = sourcedoc.Tables(1).Cell(CmbCompany.ListIndex + 2,
2).Range.Paragraphs(i).Range
myitem.End = myitem.End - 1
CmbSalesRep.ADDITEM myitem.Text
Next i
sourcedoc.Close SaveChanges:=wdDoNotSaveChanges
End Sub
The above is from a userform in a template where the user selects a company
from a combobox and then another combobox is populated with the sales
representatives for that company. You can use this technique to populate a
listbox in the same way.
Whether it is any better than the way that you propose, I don't know.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP