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.
promptcan contain approximately 1,000 characters, including nonprinting characters like the intrinsicvbCrLfconstant.If the
titleparameter is omitted, “VBScript” is displayed in the titlebar.If you don’t use the
default ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access