472,096 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

From Listbox to Word

Hi, Im using alistbox to insert names in a word document, im' using the following code but it only inserts the first name.

Dim strList1 As String
strList1 = PODERES.ListBox1.List(PODERES.ListBox1.ListIndex)
ActiveDocument.Bookmarks("p91").Range.Text = strList1

My question is, how can i do to insert ALL items in the listbox in word, the thing is i need them to be separated by comas and the last one by "and". Ex:

Of course, if theres only 1 item i need the "and" to be deleted. Ex:

Sep 3 '09 #1
0 1144

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Andy Weinmann | last post: by
1 post views Thread by Seth Delaney | last post: by
1 post views Thread by Microskills | last post: by
1 post views Thread by Microskills | last post: by
4 posts views Thread by CrimeMaster | last post: by
14 posts views Thread by Professor Yonce | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.