This documentation is archived and is not being maintained.

UI2.Confirm Method (Microsoft.Office.Interop.InfoPath.SemiTrust)

Displays a message box with buttons for input from a user.

This method is not CLS-compliant.  

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in

XdConfirmChoice Confirm (
	string bstrPrompt,
	XdConfirmButtons lButtons



The text message to be displayed.


Specifies the number and type of buttons to display. You may specify any of the values of the XdConfirmButtons enumeration.

Return Value

An XdConfirmChoice enumeration.


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.

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);