Display Method

Microsoft Word Visual Basic

Display Method

       

Displays the specified built-in Word dialog box until either the user closes it or the specified amount of time has passed. Returns a Long that indicates which button was clicked to close the dialog box.

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.

Note   Any actions initiated or settings specified while a dialog box is displayed using this method aren't carried out. Use the Show method to display a dialog box and carry out actions or apply settings.

expression.Display(TimeOut)

expression   Required. An expression that returns a Dialog object.

TimeOut   Optional Variant. 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 closes it.

Example

This example displays the About dialog box.

Dim dlgAbout As Dialog

Set dlgAbout = Dialogs(wdDialogHelpAbout)
dlgAbout.Display

This example displays the Zoom dialog box for approximately nine seconds.

Dialogs(wdDialogViewZoom).Display TimeOut:=9000