1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01021244"><META NAME="lcid" CONTENT="1033"><title>MailEnvelope Object</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><h1>MailEnvelope Object</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="properties" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="methods" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="events" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><table class="ofvbaomart"><tr><td class="noborder" nowrap="true"><A HREF="xdobjMailEnvelope.htm" title="MailEnvelope"><SPAN class="omblue">MailEnvelope</SPAN></A><br /></td></tr></table><p>Represents a custom e-mail message in a Microsoft Office InfoPath 2003 form. The <b class="bterm">MailEnvelope</b> object provides a number of properties that can be used to programmatically create a custom e-mail message within the default e-mail editor, and it attaches the currently open InfoPath form to the message.</p><h2>Remarks</h2><p>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.</p><p><b>Note</b> The <b class="bterm">MailEnvelope</b> object cannot be used to send the e-mail messages it creates; users must manually send the e-mail messages.</p><p>You can also use the <b class="bterm"><a href="xdmthShowMailItem.htm" id="HV01021415" lcid=" ">ShowMailItem</a></b> method of the <b class="bterm"><a href="xdobjUI.htm" id="HV01021247" lcid=" ">UI</a></b> object to programmatically create e-mail messages.</p><h2>Using the MailEnvelope object</h2><p>The <b class="bterm">MailEnvelope</b> object is accessed through the <b class="bterm"><a href="xdproMailEnvelope.htm" id="HV01021306" lcid=" ">MailEnvelope</a></b> property of the <b class="bterm"><a href="xdobjWindow.htm" id="HV01021252" lcid=" ">Window</a></b> object.</p><p>In the following example from the Meeting Agenda sample form, the <b class="bterm">MailEnvelope</b> property of the <b class="bterm">Window</b> object is used to set a reference to the <b class="bterm">MailEnvelope</b> object that is associated with the currently active window. The code then uses the <b class="bterm">MailEnvelope</b> object to create a custom e-mail message.</p><pre><code>function SendMeetingAgendaBtn::OnClick(oEvent)
{
var rgRecipients = new Array();
var xmlRecipients = getNodeList("/mtg:meetingAgenda/
mtg:attendees/mtg:attendee/mtg:emailAddressPrimary");
var xmlRecipient;
while (xmlRecipient = xmlRecipients.nextNode())
rgRecipients.push(xmlRecipient.text);
try
{
var oEnvelope = Application.ActiveWindow.<b class="bterm">MailEnvelope</b>;
oEnvelope.Subject = getNode("/mtg:meetingAgenda/mtg:subject").text;
oEnvelope.To = rgRecipients.join("; ");
oEnvelope.Visible = true;
}
catch(ex)
{
XDocument.UI.Alert(ex.description);
}
}</code></pre><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdobjMailEnvelope_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|