I need to have a user select one of multiple locations and then input the selected location in to a path. When doing a web search all I find, is related to asp and web. I just need a window box with a drop down list to choose one of our locations.
This can't be done natively with pure vbscript. You can however create and HTA and do it with a combination of vbscript and HTML.
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
Here's a bit of code that should get you started. I use this method to print labels in specific formats. Hope this helps.
mapman04
Dim strMsg,inp01,strTitle,strFlag
strTitle = "Answer Box"
strMsg = "Enter A for Alaska" & vbCR
strMsg = strMsg & "Enter D for Delaware" & vbCR
strMsg = strMsg & "Enter T for Texas" & vbCR
strFlag = False
Do While strFlag = False
inp01 = InputBox(strMsg,"Make your selection")
Select Case inp01
Case "A"
MsgBox "You picked Alaska!",64,strTitle
strFlag = True
Case "D"
MsgBox "You picked Delaware!",64,strTitle
strFlag = True
Case "T"
MsgBox "You picked Texas!",64,strTitle
strFlag = True
Case Else
MsgBox "You made an incorrect selection!",64,strTitle
End Select
how about a dummy folder structure which lists all the locations???
you can then launch a FileDialog box and get the user to select the folder or file which has the location name???
silly suggestion perhaps.
Well for something with folders to work you would have to make a directory structure on your harddrive. You would need a folder to represent each choice.
If you are using strictly Windows XP I know there is a way to use a much nicer file dialog box but I can't find what it is called. (maybe somebody else know off the top of their head)
As TomThumbKP suggested eariler, try using a HTA. Copy this code into a text file and then save it as "Site.HTA". Then click on it and it should open giving you your drop down box.
(A thanks to TomThumbKP for the assistance with a HTA I was working on.)
Select Case strProduct
Case "Ohio"
MsgBox "You selected Ohio",64,"Selection"
Case "Texas"
MsgBox "You selected Texas",64,"Selection"
Case "Site 22"
MsgBox "You selected Site 22",64,"Selection"
Case "Site 70"
MsgBox "You selected Site 70",64,"Selection"
End Select
End Sub
Sub btn02_OnClick
Window.Close
End Sub
</SCRIPT>
<H2>Drop Down Example</H2>
<P>Please select the Site:
<SELECT NAME="Site">
<OPTION>Ohio</OPTION>
<OPTION>Texas</OPTION>
<OPTION>Site 22</OPTION>
<OPTION>Site 70</OPTION>
</SELECT><P>
<BR>
<BR>
<Input Type = "Button" Name = "btn01" VALUE = "SUBMIT">
<Input Type = "Button" Name = "btn02" VALUE = "CLOSE">
<BR>
<BR>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.