Total items in listbox??

G

Greg Smith

I have a listbox that imports custom information.

[1] What line of code would I use to get the total number
of items in the listbox??

[2] What about code to check if the listbox has been
populated??

Thanks, Greg
 
S

Sue Mosher [MVP]

The URL provided shows how to get an Outlook control as an object. ListCount would be a property of that object. Hence:

Set objPage = Item.GetInspector.ModifiedFormPages("My Page")
Set objControl = objPage.Controls("ListBox1")
MyCount = objControl.ListCount
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


Greg Smith said:
I went to the link that you provided and even selected all
the links on the page but I did not see anything that
covered listcount. Can you tell me how to use it?? An
example would be great.
-----Original Message-----
You can use the ListCount property for both (if the count
= 0, the list box isn't populated). If you're not up to
speed on referencing Outlook form controls in form
VBSCript, see
http://www.slipstick.com/dev/propsyntax.htm#unbound.
I have a listbox that imports custom information.

[1] What line of code would I use to get the total number
of items in the listbox??

[2] What about code to check if the listbox has been
populated??

Thanks, Greg
.
 

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