Variables and listbox

  • Thread starter Serge Hipontoise
  • Start date
S

Serge Hipontoise

Hello
I'm reaaaaaly new to this
What I try to do is to store in a file many sentences (in an array I guess
?)
And show them via a userform in a combobox, so when I select one, it is
paste in the text
I'd like also have the possibility to add a sentence in a text box and
delete some, the whole thing via the same user form
Is it possible
Thank you very much
Cheers
Serge
 
C

Cindy Meister -WordMVP-

Hi Serge,
What I try to do is to store in a file many sentences (in an array I guess
?)
And show them via a userform in a combobox, so when I select one, it is
paste in the text
Are you familiar with Word's AUTOTEXT functionality? That sounds like what
you're describing...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

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

Cindy Meister -WordMVP-

Hi Serge,
I'm not very familiar with VBA, but I try to have differen sentences in an
array (or Collection, or even scripting.dictionary objects) and
add/modify/remove elements in it via a userform
you can do that, I just wanted to make sure you were aware of the built-in
possibility before you went to a lot of trouble.

An array would be best, yes. The Combobox control has a List() property to
which you can assign an array. Example:

Private Sub UserForm_Initialize()
Dim aList(2)
aList(0) = "One"
aList(1) = "Two"
aList(2) = "Three"
ComboBox1.List() = aList()
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

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