Share via


UI2.ShowMailItem Method

Creates an e-mail message in the default e-mail editor and attaches the currently open Microsoft Office InfoPath form to the message.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

Syntax

'Declaration
'Usage

Parameters

  • bstrTo
    The e-mail address to send the e-mail message to.
  • bstrCC
    The e-mail address to copy the e-mail message to.
  • bstrBCC
    The e-mail address to blind copy the e-mail message to.
  • bstrSubject
    The subject of the e-mail message.
  • bstrBody
    The body text of the e-mail message.

Remarks

After the e-mail message is created, the default e-mail editor will display the e-mail message; users can then inspect and edit the e-mail message before sending it. The ShowMailItem method will return an error if no e-mail editing program is available.

Note

The ShowMailItem method does not send the e-mail messages it creates; users must manually send the e-mail messages.

You can also use the MailEnvelopeObject object or EmailAdapterObject object to programmatically create e-mail messages.

Example

In the following example, the ShowMailItem method of the UIObject object is used to create a custom e-mail message:

thisXDocument.UI.ShowMailItem("someone@example.com", "", "", "Updated Form", "Here is the updated form that you requested.");

See Also

Reference

UI2 Interface
UI2 Members
Microsoft.Office.Interop.InfoPath Namespace