I do this Word/DB connectivity stuff all the time (see samples:
http://www.mousetrax.com/Consulting_Solutions.html).
What you need to do first is setup an ADO connection (ActiveX Data
Object). Once you have the connection, then you can query the DB with
SQL to create a RecordSet. From there, you simply use that RS to pull
or populate whatever you want to/from Word <--> Access/SQL DBs.
I have a sample on my web site with open code so you can see how to
create the ADO link...the code will get you started. It's fairly
elementary code to help newbies understand it.
Go here:
http://www.mousetrax.com/techpage.html#autoforms
Read the PLEASE FILL OUT THIS FORM article marked as # 5 for Database
Connectivity. Download the associated sample zip file. There you'll
find a sample Word AutoForm with sample Access DB to show you how to
create the connection to open a ADO "tunnel" between the two..
To actually populate the ListBox, you'll just need to write a loop
that inserts the first record in the set as you want it...and
continues to loop through the DB using... Do Until RS.EOF (do until
end of record set) to continue adding each record. If you want them
all...you'd query with SELECT * FROM MyTable to give you the entire DB
list. This stuff gets added to your form's initialization event.
Have fun! ;-)
Dian D. Chapman
Technical Consultant, Microsoft MVP
MOS Certified, Editor/TechTrax
Free MS Tutorials:
http://www.mousetrax.com/techtrax
Free Word eBook:
http://www.mousetrax.com/books.html
Optimize your business docs:
http://www.mousetrax.com/consulting
Learn VBA the easy way:
http://www.mousetrax.com/techcourses.html