UI2.Confirm Method
Displays a message box with buttons for input from a user.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
Function Confirm ( _
bstrPrompt As String, _
lButtons As XdConfirmButtons _
) As XdConfirmChoice
'Usage
Dim instance As UI2
Dim bstrPrompt As String
Dim lButtons As XdConfirmButtons
Dim returnValue As XdConfirmChoice
returnValue = instance.Confirm(bstrPrompt, _
lButtons)
XdConfirmChoice Confirm(
string bstrPrompt,
XdConfirmButtons lButtons
)
Parameters
bstrPrompt
Type: System.StringThe text message to be displayed.
lButtons
Type: Microsoft.Office.Interop.InfoPath.SemiTrust.XdConfirmButtonsSpecifies the number and type of buttons to display. You may specify any of the values of the XdConfirmButtons enumeration.
Return Value
Type: Microsoft.Office.Interop.InfoPath.SemiTrust.XdConfirmChoice
An XdConfirmChoice enumeration.
Remarks
Important
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
Examples
In the following example, the Confirm method of the UIObject object is used to display a dialog box with Yes and No buttons:
thisXDocument.UI.Confirm("Do you wish to continue?", XdConfirmButtons.xdYesNo);