I am trying to create a Word COM Addin that displays a windows form and multi-column listbox. At the basic level, I want to populate the list box using a two dimensional array as I've tried below. In actual practice I would like to populate an unbound listbox using the data from an Excel worksheet or Access database. Can that be done? I'm familiar with VBA and realize that VB and VBA are different, so I am wondering if there is a VB equivalent to VBA ListBox1.List?
I'm very new to VB so perhaps I am all wrong in trying to use windows form or a windows form listbox. Is there something else I should use? It would certainly flatten the learning curve if it were possible to use a VBA userform in my project. Is that possible?
Thanks
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load Dim myList(2, 1) As String myList(0, 0) = "One" myList(0, 1) = "1" myList(1, 0) = "Two" myList(1, 1) = "2" myList(2, 0) = "Three" myList(2, 1) = "1" 'Error here. ListBox1.List myList End Sub
Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm