<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Accessing Intro field in MailEnvelope object</title><link>https://www.infopathdev.com:443/forums/thread/14800.aspx</link><pubDate>Fri, 22 Sep 2006 17:29:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14800</guid><dc:creator>mbenbow</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14800.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14800</wfw:commentRss><description>Hey,&lt;br /&gt;&lt;br /&gt;The MailEnvelope object does not expose the Intro property.  However, the EmailAdapter object does expose the Intro Property.&lt;br /&gt;You can access the EmailAdapter object via XDocument.DataAdapters("Name of data adapter")&lt;br /&gt;&lt;br /&gt;Alternatively, you can program directly to Outlook which will create an email message but not send it directly (but you can only attach a MHT version of the form in the email)....the following was written in VBScript:&lt;br /&gt;&lt;br /&gt;Sub CreateMailMsg(sTo, sCC, sBCC, sSubj, sBody, sAttachFile)&lt;br /&gt;'purpose	creates an outlook message and attaches the MHT file created above&lt;br /&gt;'date		04/19/2006&lt;br /&gt;&lt;br /&gt;	Dim objOlApp&lt;br /&gt;	Dim objItm&lt;br /&gt;	Set objOlApp = CreateObject("Outlook.Application")&lt;br /&gt;	Set objItm = objOlApp.CreateItem(olMailItem)&lt;br /&gt;&lt;br /&gt;	With objItm&lt;br /&gt;&lt;br /&gt;		.To = sTo&lt;br /&gt;		.CC = sCC&lt;br /&gt;		.BCC = sBCC&lt;br /&gt;		.Subject = sSubj&lt;br /&gt;		.Body = sBody&lt;br /&gt;		.Attachments.Add sAttachFile&lt;br /&gt;		.Display&lt;br /&gt;&lt;br /&gt;	End With&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Function CreateMHT(sFormNum)&lt;br /&gt;'purpose	to create a MHT web file of the form with its data for the user&lt;br /&gt;'date		4/13/2006&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	Dim wshShell,oFileSys, filePath, sFormFile, myDocs, sFile, sDate&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	'unique name for file&lt;br /&gt;	sDate = Year(Now) &amp; Month(Now) &amp; Day(Now) &amp; "_" &amp; Hour(Now) &amp; Minute(Now) &amp; Second(Now)&lt;br /&gt;	sFile = sFormNum &amp; "_" &amp; sDate &amp; ".mht"&lt;br /&gt;&lt;br /&gt;	Set wshShell = Createobject("WScript.Shell")&lt;br /&gt;&lt;br /&gt;	'path to user's data&lt;br /&gt;	myDocs = wshShell.SpecialFolders("MyDocuments")&lt;br /&gt;	filePath = myDocs &amp; "\Forms\" &lt;br /&gt;&lt;br /&gt;	'check if path file exists&lt;br /&gt;	Set oFileSys = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;	&lt;br /&gt;	If oFileSys.FolderExists(filePath) Then&lt;br /&gt;		sFormFile = filePath &amp; sFile&lt;br /&gt;	Else&lt;br /&gt;		sFormFile = myDocs &amp; sFile&lt;br /&gt;	End if&lt;br /&gt;	&lt;br /&gt;	'check to see if the file exists - if it does, overwrite it&lt;br /&gt;	If oFileSys.FileExists(sFormFile) Then&lt;br /&gt;		oFileSys.DeleteFile sFormFile, True&lt;br /&gt;	end if&lt;br /&gt;	&lt;br /&gt;	'create the mht file - needs digital certificate to do this&lt;br /&gt;	XDocument.View.Export sFormFile, "MHT"&lt;br /&gt;&lt;br /&gt;	CreateMHT = sFormFile&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Hope that helps!&lt;br /&gt;MB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Accessing Intro field in MailEnvelope object</title><link>https://www.infopathdev.com:443/forums/thread/12950.aspx</link><pubDate>Fri, 22 Sep 2006 16:28:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12950</guid><dc:creator>dloeffl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12950.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12950</wfw:commentRss><description>I am trying to use some simple code to create an e-mail that users can send.  I do not want the sending to be automatic because the process is not perfectly rigid.  Here is the code:&lt;br /&gt;&lt;br /&gt;if(to!="" &amp;&amp; subject!="")&lt;br /&gt;{&lt;br /&gt;var objEmail = Application.ActiveWindow.MailEnvelope;&lt;br /&gt;objEmail.To = to; &lt;br /&gt;objEmail.CC = cc;&lt;br /&gt;objEmail.Subject = subject;&lt;br /&gt;objEmail.Intro = intro;&lt;br /&gt;objEmail.Visible = true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Using this method it does not appear that I can pre-populate the "Intro" field as I get a "Object doesn't support this property or method" error referring to the "objEmail.Intro = intro;" line.  Does anyone know if this is possible and how it can be done?</description></item></channel></rss>