The UI Object The UI object represents some InfoPath user interface components . The methods of the UI object cause various message boxes to be displayed. You are already familiar with the Alert() method of the UI object, which has been used in several sample form templates in this chapter and in earlier chapters. The Alert() method of the UI object is accessed via the XDocument object: XDocument.UI.Alert("Your custom message goes here."); UI Object Methods The UI object has four methods: -
Alert() ” Displays a custom message box. The single argument is a string displayed in the message box. Security level 2. -
ShowMailItem() ” Creates an email message in the default email editor, and causes the current InfoPath form to be attached to the email message. Security level 2. -
ShowModalDialog() ” Displays a custom dialog box. Security level 3. -
ShowDigitalSignatures() ” Causes the InfoPath digital signature dialog box to be displayed. The form must have digital signing enabled. Security level 2. The ShowMailItem() Method The ShowMailItem() method has five arguments: -
A string that contains the email address(es) to which the email is to be sent -
A string that contains the email address(es) to which the email is to be visibly copied -
A string that contains the email address(es) to which blind copies should be sent -
A string that consists of the subject of the message -
A string that is the body of the email message All five arguments are required. When there are, for example, no blind copies, you must insert an empty string indicated by paired quotation marks ( "" ). The ShowModalDialog() Method The ShowModalDialog() method has six arguments. The first is required, and the others are optional: -
A string that is the name of an HTML file used in the modal dialog box -
Arguments to be used in the modal dialog box -
A Variant value that defines the height of the modal dialog box -
A Variant value that defines the width of the modal dialog box -
A Variant value that defines the position of the top of the modal dialog box relative to the top-left corner of the window -
A Variant value that defines the position of the left edge of the modal dialog box relative to the top-left corner of the window UI Object Properties The UI object has no properties. |