VBScript, seperating the output of an echo to columns

Ok.. so I got some help earlier that proved right on, but hadn't forseen the result...
The following script enumerates all the users in the specified OU and echos them to a single message box as a long list.  The problem is if the list is longer than the screen, it just doesn't show the rest of the list.  I need a way for the output (wscript.echo) to be split into columns of 30 lines max or to make the message box scrollable.

Dim UsersInOU(500)
      Set objOU = GetObject("LDAP://" & UserOUPath)
            i = 0
            objOU.Filter = Array("user")
                 For Each objUser In objOU
                      UsersInOU(i) = objUser.Name
                      i = i + 1
                      X = i
                 Next

      Dim strTemp : strTemp = ""

                  For Y = 0 To X
                        strTemp =  strTemp & Y  & " - " & mid(UsersInOu(Y),4,30) & Vbcr
                  Next
Wscript.echo strTemp

Thanks in advance!
LVL 2
RanidaeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kapesCommented:
I read your requirement with inputbox..
try this
--------

strtemp = ""
For Y = 0 To X
if (Y Mod 30) = 0 then
      strTemp =  strTemp & Y  & " - " & mid(UsersInOu(Y),4,30)
                UserID = inputbox("These are the users in the selected group" & strTemp & "What user requires management? (Enter User # or click CANCEL to see next screen)","Users")
      If not IsEmpty(userid) Then
            WScript.Echo "user id selected: " & userid
            Exit For
      End If
      strtemp = ""
Else
      strTemp =  strTemp & Y  & " - " & mid(UsersInOu(Y),4,30) & vbcr
end If
Next

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RanidaeAuthor Commented:
Way closer... only it only displays the first user name on the first screen then displays 30 on the second third and so on until it only displays X on the last where X is whatever is left and less than 30.
0
RanidaeAuthor Commented:
Hey Kapes, you ROCK!  Thanks for your help... your guidance got me to a point where at least it works!  It may not be pretty but it does what it's supposed to do.

I'll tweak some more later... but for now, here's what it looks like.

Dim UsersInOU(500)
Set objOU = GetObject("LDAP://" & UserOUPath)
i = 1
objOU.Filter = Array("user")
     For Each objUser In objOU
          UsersInOU(i) = objUser.Name
          i = i + 1
          X = i
     Next
Dim strTemp : strTemp = ""

For Y = 1 To 30
strTemp =  strTemp & Y  & " - " & mid(UsersInOu(Y),4,50) & Vbcr
Next

UserID = inputbox("These are the users in the selected group" & Vbcr & Vbcr & strTemp & Vbcr & "What user requires management? (Enter User # or click CANCEL to see next screen)","Users")
            
            If UserID="" Then
                  strTemp = ""
                  For Y = 31 To 60
                  strTemp =  strTemp & Y & " - " & mid(UsersInOu(Y),4,50) & Vbcr
                  Next
                  UserID = inputbox("These are the users in the selected group" & Vbcr & Vbcr & strTemp & Vbcr & "What user requires management? (Enter User # or click CANCEL to see next screen)","Users")
            End if
            If UserID="" Then
                  strTemp = ""
                  For Y = 61 To 90
                  strTemp =  strTemp & Y & " - " & mid(UsersInOu(Y),4,50) & Vbcr
                  Next
                  UserID = inputbox("These are the users in the selected group" & Vbcr & Vbcr & strTemp & Vbcr & "What user requires management? (Enter User # or click CANCEL to see next screen)","Users")
            End if

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.