Name
InputBox Function
Syntax
InputBox(prompt
[,title
] [,default
] [,xpos
] [,ypos
] [,helpfile
,context
])
-
prompt
Use: Required
Data Subtype: String
The message in the dialog box.
-
title
Use: Optional
Data Subtype: String
The titlebar of the dialog box.
-
default
Use: Optional
Data Subtype: String
String to be displayed in the text box on loading.
-
xpos
Use: Optional
Data Subtype: Numeric
The distance from the left side of the screen to the left side of the dialog box.
-
ypos
Use: Optional
Data Subtype: Numeric
The distance from the top of the screen to the top of the dialog box.
-
helpfile
Use: Optional
Data Subtype: String
The Help file to use if the user clicks the Help button on the dialog box.
-
context
Use: Optional
Data Subtype: Numeric
The context number to use within the Help file specified in
helpfile
.
Return Value
InputBox
returns a variant string containing the
contents of the text box from the InputBox
dialog.
Description
Displays a dialog box containing a label, which prompts the user about the data you expect them to input, a text box for entering the data, an OK button, a Cancel button, and optionally a Help button. When the user clicks OK, the function returns the contents of the text box.
Rules at a Glance
If the user clicks Cancel, a zero-length string (“”) is returned.
prompt
can contain approximately 1,000 characters, including nonprinting characters like the intrinsicvbCrLf
constant.If the
title
parameter is omitted, “VBScript” is displayed in the titlebar.If you don’t use the
default ...
Get VBScript in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.