esperanto234
Sep 7, 2009, 09:51 AM
Hi, Im using alistbox to insert names in a word document, I'm using the following code but it only inserts the first ITEM on the list.
Code:
Dim strList1 As String
strList1 = ListBox1.List(ListBox1.ListIndex)
ActiveDocument.Bookmarks("p91").Range.Text = strList1
My question is: How can I do to insert ALL items in the listbox in word. I need them to be separated by comas and the last one by "and". Ex:
ITEM1, ITEM2, ITEM3 and ITEM4.
ITEM1, ITEM2 and ITEM3.
ITEM1, ITEM2 and ITEM5.
Of course, if there's only 1 item I need the "and" to be deleted. Ex:
ITEM1
THANK YOU VERY VEERY MUCH!
Code:
Dim strList1 As String
strList1 = ListBox1.List(ListBox1.ListIndex)
ActiveDocument.Bookmarks("p91").Range.Text = strList1
My question is: How can I do to insert ALL items in the listbox in word. I need them to be separated by comas and the last one by "and". Ex:
ITEM1, ITEM2, ITEM3 and ITEM4.
ITEM1, ITEM2 and ITEM3.
ITEM1, ITEM2 and ITEM5.
Of course, if there's only 1 item I need the "and" to be deleted. Ex:
ITEM1
THANK YOU VERY VEERY MUCH!