How do I read the content from a given listbox?

S

stephenc

I have a two-column listbox, populated with paths in column 1 and filenames
in column 2. How do I get the text from just column 2?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?c3RlcGhlbmM=?=,
I have a two-column listbox, populated with paths in column 1 and filenames
in column 2. How do I get the text from just column 2?
Example:

ComboBox1.List(ComboBox1.ListIndex, 1)

You can retrieve the information from any row/col combination using the .List
property. ListIndex will give you the currently selected item. As the second
argument, use the col index (0 = first column).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
S

stephenc

Thanks Cindy. Much appreciated.

Cindy M -WordMVP- said:
Hi =?Utf-8?B?c3RlcGhlbmM=?=,

Example:

ComboBox1.List(ComboBox1.ListIndex, 1)

You can retrieve the information from any row/col combination using the .List
property. ListIndex will give you the currently selected item. As the second
argument, use the col index (0 = first column).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top