Link to home
Start Free TrialLog in
Avatar of srinivas_vemla
srinivas_vemla

asked on

MS Word VBA Listbox visible property

Hello Friends,

I could not find a forum where I could place this question and this was the closest.

I want to hide a listbox item in MS Word Form using VBA, but I don't see any visible property for the Listbox. Any roundabouts?

Regards,
Srinivas
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

AFAIK you cant 'hide' individual rows in the standard ListBox, you can only add or remove them.
Avatar of srinivas_vemla
srinivas_vemla

ASKER

I want to hide the whole listbox. Not a single item in the listbox. Any way to do that in VBA?
Yes.  In VBA code use Me.YourLisboxName.Visible = False
I checked my original question just now. Sorry for phrasing it badly.

I want to hide the listbox "control" (not an item in it) as a whole, but I don't find any property for that. Any suggestions?
There should be a .Visible property in every control.  If you don't see it in a Properties dialog, try setting it programmatically and see what happens.
The "Visible" property does not seem to be a part of ListBox control in MS Word VBA. I checked that and it gives me an error as no such property.
I recommend creating a 20-pt 'linking' question in the Word TA, with the URL from this question copy/pasted, so the Word experts can take a crack at providing you a soluition.
Howdy.

jimhorn is right on track, srinivas_vemla.  If you enter code in a Command button or in UserForm.Activate "ListBox1.", it doesn't have "Visible"?  I see it using Word VBA with Office 2000 and Win2k Pro.
to clarify...

you want to use the listbox in the MS word form (i.e. a document) or on an MS Word Userform?

a document dmang, not a userform
ASKER CERTIFIED SOLUTION
Avatar of edwardiii
edwardiii

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks edwardiii,

This surely works for me...

Thanks,
Srinivas