Dialog.Show Method

Displays and carries out actions initiated in the specified built-in Microsoft Word dialog box. Returns an Integer that indicates which button was clicked to close the dialog box.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function Show ( _
    ByRef TimeOut As Object _
) As Integer
'Usage
Dim instance As Dialog
Dim TimeOut As Object
Dim returnValue As Integer

returnValue = instance.Show(TimeOut)
int Show(
    ref Object TimeOut
)

Parameters

  • TimeOut
    Type: System.Object%
    Optional Object. The amount of time that Word will wait before closing the dialog box automatically. One unit is approximately 0.001 second. Concurrent system activity may increase the effective time value. If this argument is omitted, the dialog box is closed when the user dismisses it.

Return Value

Type: System.Int32

Remarks

Return value

Description

-2

The Close button.

-1

The OK button.

0 (zero)

The Cancel button.

> 0 (zero)

A command button: 1 is the first button, 2 is the second button, and so on.

Use the Show method shows the specified built-in Word dialog box, then (if the user clicks the OK button) carry out the actions specified by the user in the dialog box. The Display method, on the other hand, displays the specified built-in Word dialog box, but takes no action after the user closes the dialog box. Therefore, you should choose the method to use as follows:

  • Use the Display method if the actions the user will take in the dialog box are completed before the user closes the dialog box - for example, when the user customizes a menu or toolbar by using the Customize dialog (wdDialogToolsCustomize). You can also use the Display method if you want to ignore the actions requested by the user, if those actions are normally completed after the user closes the dialog box.

  • Use the Show method if the actions the user will take in the dialog box are normally completed after the user closes the dialog box - for example, when the user selects a file to open by using the Open dialog (wdDialogFileOpen).

See Also

Reference

Dialog Interface

Dialog Members

Microsoft.Office.Interop.Word Namespace