Contents

# InputBox Function

Displays a prompt in a dialogue box at which the user can enter text. The input is assigned to a variable.

The InputBox statement is a convenient method of entering text through a dialogue box. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialogue box with Cancel, InputBox returns a zero-length string ("").

### Syntax:

    InputBox (Prompt As String[, Title As String[, Default As String[, xpostwips As Integer, ypostwips As Integer]]]) As String

### Parameters:

prompt: String expression displayed as the message in the dialogue box.

title: String expression displayed in the title bar of the dialogue box.

default: String expression displayed in the text box as default if no other input is given.

xpostwips: Integer expression that specifies the horizontal position of the dialogue box. The position is an absolute coordinate and does not refer to the window of LibreOffice.

ypostwips: Integer expression that specifies the vertical position of the dialogue box. The position is an absolute coordinate and does not refer to the window of LibreOffice.

If xpostwips and ypostwips are omitted, the dialogue box is centred on the screen. The position is specified in twips.

### Return type:

String

### Example:

    Sub ExampleInputBox
    Dim sText As String
        sText = InputBox("Please enter a phrase:", "Dear User")
        MsgBox(sText, 64, "Confirmation of phrase")
    End Sub