Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Inputbox information too long?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62203
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Inputbox information too long?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Inputbox information too long? - 7/7/2008 10:42:34 PM   
  Stumpedtechy

 

Posts: 41
Score: 0
Joined: 11/30/2007
Status: offline
I have a problem that is strange. I have an input box that is created by listing the OU structure of the domain. The fact we have the domain with each site having its own container makes this quite a large list. The problem is I can't see the bottom of the list (including the line to input on). How can I split up the inputbox function so I can ensure it is seen on one screen and then maybe add a "continue" option or something if they don't see it on the first screen?

BTW I am not in charge of the OU structure so its not possible to manipulate that portion of things -

This is the found code I have been using -

Sub SearchDom(sADSPath) 'menu to pick OU
Dim oRS
Dim iChoice
i = 1
'Create a query for OUs using SQL syntax
oCommand.Properties("Searchscope") = ADS_SCOPE_ONELEVEL
oCommand.CommandText = _
   "SELECT Name, distinguishedname FROM 'LDAP://"& sADSPath &"' WHERE objectClass='organizationalUnit'" 
Set oRS = oCommand.Execute

If oRS.EOF = True Then 'no more OUs under.  Exit
Exit Sub
End If

oRS.MoveFirst
Do Until oRS.EOF
'Add the name and the dn -- here ADSPath to dictionary.
   d.Add i &") " &  oRS.Fields("Name").Value, oRS.Fields("distinguishedname").Value
   oRS.MoveNext
   i = i + 1
Loop

iChoice = d.Keys              ' Get the keys.
'OUName = d.Items

message =""  'Build the menu

For i = 0 To d.Count -1 ' Iterate the names
   message = message &   iChoice(i)  & VbCrLf
Next

message = message & _
"      --- Current Path ---- " & vbcrlf & _
"0) " & sADSPath & VbCrLf 

iChoice = InputBox(message,"Enter Choice to Navigate OUs",0)
If iChoice = "" Then WScript.Quit
If iChoice = 0 Then Exit Sub

'okay.  This is a kludge. You could do this with a multidimensional array
'or even a recordset. But it was fast and easy!

Dim a,b
a = d.Items
b = d.Keys   'Cleaning up from menu stuff to get logfile
sADSPath = a(iChoice-1)
d.RemoveAll   'Clear the dictionary
message = ""
SearchDom sADSPath 'And start again...
End Sub
 
 
Post #: 1
 
 RE: Inputbox information too long? - 7/7/2008 11:00:32 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Might want to look into using an HTA.  Then you can have a scroll bar and/or multiple rows. 

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Stumpedtechy)
 
 
Post #: 2
 
 RE: Inputbox information too long? - 7/7/2008 11:43:45 PM   
  Stumpedtechy

 

Posts: 41
Score: 0
Joined: 11/30/2007
Status: offline
Yeah the problem is with our image if I run HTA's I have to go in and modify I.E. settings to not get the prompts. I am trying to avoid these for the less technical of our group. Any thoughts on how to do it with regular VBS?

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Inputbox information too long? - 7/8/2008 12:03:34 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You could try to do columns using vbTab

test = "Something" & vbTab & "Something2" & vbTab & "Something" & vbCr & "Something" & vbTab & "Something2" & vbTab & "Something"
InputBox(Test)

The above has 3 tabs.  But depending on the length of the OU names you can do 2.  Also, as a kludgey  workaround.  You can write the OU's to a text file, then display the text file and tell the user to select one.  I.e
1-OU1
2-OU2
3-OU3 etc

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Stumpedtechy)
 
 
Post #: 4
 
 RE: Inputbox information too long? - 7/8/2008 5:18:57 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
What prompts are you getting?

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Stumpedtechy)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Inputbox information too long? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts