Link to home
Start Free TrialLog in
Avatar of ymilan
ymilan

asked on

Vbscript and Inputbox

Hello,

I'd like to know if one can specify message box size and using vbscript and wsh for an Inputbox using the format InputBox("Available options are:" & VbCrLf & _
etc.......

Thank you kindly.
Avatar of RobSampson
RobSampson
Flag of Australia image

As far as I know, you can't set the colour and size, but can add spaces just by formatting the string that you output.
For example, if you put
"This" & vbCrLf & "Text"
you will see:
This
Text
and if you put
"This" & vbCrLf & vbCrLf & "Text"
you will see:
This

Text
You can see that adding vbCrLf acts as a line break, and you can add blank lines in this way.
You can also use vbTab for tab characters, add extra spaces with a string like "    ", etc.

If you *really* wanted to customise the InputBox, you *may* be able to create a modal HTA application, which is basically a HTML page that you could the user with.

If you want help with that, let me know.

Regards,

Rob.
Avatar of wsh2
wsh2

If you want to be fancy.. you can use VbScript and the Browser to process, read and write HTML pages via the Document Object.
Avatar of ymilan

ASKER

Rob, Thank you.  Ok, want to know how to do an HTA for the inputBox you gave me info on/replied to regarding my first message on WSH and VBscript.  I tried to get it working and I cannot seem to get the syntax correct; can you assist please?  Thank you.

Also, thank you wsh2 for your answer too....

ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice example RobSampson.. Thank you.. <smile>.
No problem.  You can customise that if you want, which I basically do in two stages when I build a HTA.
First I usually build the HTML part and get the form looking the way I want, then I start pasting in the VBScript procedures, and get the buttons to call them.  Once the HTML part is done, the rest is pretty much pure VBScript.

Regards,

Rob.
Interesting thing here.. I run WinXP SP2 (replete with all updates).. HTA had NO file association.. I would have thought it to be an Internet Explorer default.
HTA files should actually be run using MSHTA.exe
I have not seen a situation where the file assocation does not exist, but you should be able to right-click a HTA file, click Choose Program...., browse to C:\windows\system32\mshta.exe and tick "Always use this program" and click OK.

Regards,

Rob.
Wow.. I associated it with IE7.. and it worked.. go figure.

Yhank you, I'll make it a point to make the change.. <smile>.
They *can* run using IE7, but I'm pretty sure last time I did that I kept getting the security warning thing that said ActiveX was disabled or something.  MSHTA has a security model embedded that allows these scripts to run in a more secure window.....or something.....can't remember exactly.

Rob.
MSHTA.EXE runs MUCH cleaner.. so a big " T " hank you this time.
Avatar of ymilan

ASKER

Thank you all for your comments and expertise!  You all are great!  This will definitely suite me and work!  You are AWESOME!  Thanks again!
No problem, glad to help.

Rob.