confirm Method
The document is archived and information here might be outdated

confirm Method

Office 2003

Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons and returns a Boolean that represents the user's response. True indicates that the user clicked OK. False indicates that the user clicked Cancel.


expression    Required. An expression that returns one of the objects in the Applies To list.

message    Optional String. Specifies the message to display in the confirmation dialog box. If no value is provided, the dialog box does not contain a message.


The following example displays a message to the user and captures their response in a variable.

    Dim blnResponse As Boolean

blnResponse = ActiveDocument.parentWindow _
    .confirm("Are you sure you want to do that?")

© 2016 Microsoft