RE: ListBox Population Help

  • From: "Baiju Jayarajan" <Baiju.Jayarajan@xxxxxxxxx>
  • To: "[ExchangeList]" <exchangelist@xxxxxxxxxxxxx>
  • Date: Thu, 16 Sep 2004 14:41:58 +0300

Hi Al,
find the below code which i used. the problem i face is i am getting the no of 
items in the folder, but the values are not coming to the listbox... pls help.

Sub Item_Open()

   Dim FullArray()

   ' Sets the name of page on the form (P.2)
   Set FormPage = Item.GetInspector.ModifiedFormPages("P.2")

   ' Sets Control to a list box called ListBox1.
   Set Control = FormPage.Controls("ListBox1")
' Get the default Total folder


Set ConFolder= Application.ActiveExplorer.CurrentFolder.Folders("Admin")
msgbox " folder is  " & ConFolder 

   ' Get the items in the folder
  
   Set ConItems = ConFolder.Items
    
   ' Get the number of total items in the Total folder

   NumItems = ConItems.Count
   msgbox "Number of items : " & ConItems.Count

  ' Resize array to handle total number of item in the folder
  ' ReDim Preserve FullArray(NumItems-1,1)

    msgbox "Full array : " &FullArray(1,1)

   ' Loop through all of the items in the Total folder,
   ' filling the array with sample data and keeping track
   ' of the number of Total found.

   NumTotal = 0

   For I = 1 to NumItems
on error resume next
      msgbox "Inside for loop : " &I
      
      Set itm = ConItems(I)

     If Left(itm.MessageClass, 8) = "IPM.Post" Then
        msgbox " Mesage class is " & itm.MessageClass

        FullArray(1,1) = itm.MyCity ' this is the name of the field which i 
have to populate in the listbox

        NumTotal = NumTotal + 1
        msgbox "Full array assigned"
      End If
   Next

   ' Set the control to handle 2 data columns
   Control.ColumnCount = 3

   If NumItems = NumTotal Then
      ' They are all Total, so use the FullArray
      Control.List() = FullArray
   Else
      ' There's some distribution lists, so use the smaller
      ' ConArray to eliminate extra blank values in the list box
      Dim ConArray()
      ReDim ConArray(NumTotal-1,1)
      For I = 0 to NumTotal - 1
         ConArray(I,1) = FullArray(I,1)

      Next
      Control.List() = ConArray
   End If

End Sub






-----Original Message-----
From: Mulnick, Al [mailto:Al.Mulnick@xxxxxxxxxx]
Sent: Wednesday, September 15, 2004 7:15 PM
To: [ExchangeList]
Subject: [exchangelist] RE: ListBox Population Help


http://www.MSExchange.org/

Arrays can be used.  Can you post relevant code snippets? 

-----Original Message-----
From: Baiju Jayarajan [mailto:Baiju.Jayarajan@xxxxxxxxx] 
Sent: Wednesday, September 15, 2004 12:00 PM
To: [ExchangeList]
Subject: [exchangelist] ListBox Population Help

http://www.MSExchange.org/

Hi,

I have one post form where user can maintain customer details.
I have another form where these customer details are available in a listbox.

The problem i face is , when the data grows the application is not
responding. I am adding data to the list box using additem method.

Is there any other way of populating list box other than additem?? like
arrays ... pls help...


Thanx in advance.

Best Regards

Baiju

------------------------------------------------------
List Archives: http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Exchange Newsletters: http://www.msexchange.org/pages/newsletter.asp
Exchange FAQ: http://www.msexchange.org/pages/larticle.asp?type=FAQ
------------------------------------------------------
Other Internet Software Marketing Sites:
World of Windows Networking: http://www.windowsnetworking.com Leading
Network Software Directory: http://www.serverfiles.com
No.1 ISA Server Resource Site: http://www.isaserver.org Windows Security
Resource Site: http://www.windowsecurity.com/ Network Security Library:
http://www.secinf.net/ Windows 2000/NT Fax Solutions:
http://www.ntfaxfaq.com
------------------------------------------------------
You are currently subscribed to this MSEXchange.org Discussion List as:
al.mulnick@xxxxxxxxxx To unsubscribe visit
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Report abuse to listadmin@xxxxxxxxxxxxxx

------------------------------------------------------
List Archives: http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Exchange Newsletters: http://www.msexchange.org/pages/newsletter.asp
Exchange FAQ: http://www.msexchange.org/pages/larticle.asp?type=FAQ
------------------------------------------------------
Other Internet Software Marketing Sites:
World of Windows Networking: http://www.windowsnetworking.com
Leading Network Software Directory: http://www.serverfiles.com
No.1 ISA Server Resource Site: http://www.isaserver.org
Windows Security Resource Site: http://www.windowsecurity.com/
Network Security Library: http://www.secinf.net/
Windows 2000/NT Fax Solutions: http://www.ntfaxfaq.com
------------------------------------------------------
You are currently subscribed to this MSEXchange.org Discussion List as: 
baiju.jayarajan@xxxxxxxxx
To unsubscribe visit http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Report abuse to listadmin@xxxxxxxxxxxxxx


Other related posts: