<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Exporting to MHTML or PDF</title><link>https://www.infopathdev.com:443/forums/thread/50057.aspx</link><pubDate>Fri, 18 Dec 2009 17:58:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50057</guid><dc:creator>samsonsandeep</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50057.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=50057</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a similar situation and please help me get a code for the button. One of the form content is &amp;quot;filename&amp;quot;..I want function to be as when clicked on the button it must capture the data entered in the filename textbox and save the file in .mht format in a folder path locally in computer and,&amp;nbsp;if possible,&amp;nbsp;another copy in a folder on server. Once that is done, the form must close and a new form must be opened. The local path to save the form is &amp;quot;C:\Feedback&amp;quot; and the naming of the file is to be derived from what is entered in the &amp;quot;filename&amp;quot; text box.&lt;/p&gt;</description></item><item><title>Re: Exporting to MHTML or PDF</title><link>https://www.infopathdev.com:443/forums/thread/10681.aspx</link><pubDate>Tue, 21 Nov 2006 14:38:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:10681</guid><dc:creator>mbenbow</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/10681.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=10681</wfw:commentRss><description>Hey,&lt;br /&gt;&lt;br /&gt;Here is some code that we used to create a MHT file of the form and send it via email.  Note that your form will need to be fully trusted.&lt;br /&gt;&lt;br /&gt;In the button code put the following:&lt;br /&gt;&lt;br /&gt;Dim oFormNum, oFormName, sMHT&lt;br /&gt;	Dim sTo, sCC, sBCC, sSubj, sBody&lt;br /&gt;&lt;br /&gt;	'grab the form number and title of current form&lt;br /&gt;	Set oFormNum = XDocument.DOM.selectSingleNode("//my:FORMINFO/my:FormNumber")&lt;br /&gt;	Set oFormName = XDocument.DOM.selectSingleNode("//my:FORMINFO/my:FormTitle")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	'create the MHT file 1st&lt;br /&gt;	sMHT = CreateMHT(oFormNum.Text)&lt;br /&gt;&lt;br /&gt;	'create the email envelope&lt;br /&gt;	sTo = ""&lt;br /&gt;	sCC = ""&lt;br /&gt;	sBCC = ""&lt;br /&gt;	sSubj = oFormNum.text &amp; " - " &amp; oFormName.text&lt;br /&gt;	sBody = "message for the body of the email"&lt;br /&gt;	CreateMailMsg sTo, sCC, sBCC, sSubj, sBody, sMHT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add the following subroutine and function to your script file:&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;'revised	&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;&lt;br /&gt;&lt;br /&gt;	Set wshShell = Createobject("WScript.Shell")&lt;br /&gt;&lt;br /&gt;	'path to user's data - assumes there is a Forms folder under My Documents&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;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;Hope that helps,&lt;br /&gt;MB</description></item><item><title>Exporting to MHTML or PDF</title><link>https://www.infopathdev.com:443/forums/thread/5927.aspx</link><pubDate>Mon, 20 Nov 2006 21:01:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5927</guid><dc:creator>Methtical</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5927.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5927</wfw:commentRss><description>Hello,&lt;br /&gt;I've seen all the postings for how to export an xml document.  "File &amp;gt; Export to" as well "File &amp;gt; Print &amp;gt; Adobe Distiller".&lt;br /&gt;&lt;br /&gt;Is there anyway to put an export button on the form itself so users don't have to go through those steps?  I have a time sheet that consultants have to fill out in my department.  After they are approved and digitally signed, they need to be sent to the consultant's company.  Since they won't have InfoPath, I'll need to send them a pdf or mhtml file.  Does anyone know how to do this?  I'm not real great at the custom code aspect so I'm looking for a way to do this through the Infopath interface.  If not, I could use some help on the code.  My form uses VBscript.  Any help would be appreciated.&lt;br /&gt;&lt;br /&gt;Thank you.</description></item></channel></rss>