<?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: Outlook interop assembly code in infopath form 2007 is not working with infopath 2010.</title><link>https://www.infopathdev.com:443/forums/thread/94437.aspx</link><pubDate>Thu, 21 Nov 2013 14:03:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:94437</guid><dc:creator>leoffneym</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/94437.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=94437</wfw:commentRss><description>&lt;p&gt;Can you add a try catch block so the the error is better defined.&amp;nbsp; I have an idea of what the problem may be, but the error it returns may provide more insight.&lt;/p&gt;&lt;p&gt;In your public void CTRL25_19_Clicked function add the following:&lt;/p&gt;&lt;p&gt;try{&lt;/p&gt;&lt;p&gt;&lt;em&gt;all code goes here&lt;/em&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;catch(Exception exception)&lt;br /&gt;{&lt;br /&gt;MessageBox.Show(&amp;quot;Error &amp;quot; + exception.Message);&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;This should provide you with a popup that displays more information about the error.&lt;/p&gt;</description></item><item><title>Outlook interop assembly code in infopath form 2007 is not working with infopath 2010.</title><link>https://www.infopathdev.com:443/forums/thread/94425.aspx</link><pubDate>Wed, 20 Nov 2013 17:50:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:94425</guid><dc:creator>vinuraj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/94425.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=94425</wfw:commentRss><description>Hi Team,&lt;br /&gt;

Please resolve the below issue as it was very urgent. &lt;br /&gt;

My client having requirement open a outlook window once clicked button in infopath from 2007. &lt;br /&gt;

I was resolved using below procedure  and code. &lt;br /&gt;

I have added Outlook interop reference to the infopath code project  and coded like below. &lt;br /&gt;

Interop assembly added path : C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12\Microsoft.Office.Interop.Outlook.dll &lt;br /&gt;

code : &lt;br /&gt;

public string CreatePDF() &lt;br /&gt;
        {
            // Create HTML.
            try
            {
                XPathNavigator xnDoc = this.MainDataSource.CreateNavigator(); &lt;br /&gt;
                XPathNavigator xnMyField = xnDoc.SelectSingleNode(&amp;quot;/my:XXXXXXXXXXX/my:woDetails/my:XXXXXXXXName&amp;quot; , this.NamespaceManager);&lt;br /&gt;
                wordordername = xnMyField.Value;&lt;br /&gt;
                fileName = wordordername  + &amp;quot;.pdf&amp;quot;;&lt;br /&gt;
                filePath = Path.Combine(Path.GetTempPath(), fileName);&lt;br /&gt;
                this.CurrentView.Export(filePath, ExportFormat.Pdf);&lt;br /&gt;
                
                return filePath;&lt;br /&gt;

           }&lt;br /&gt;
            catch
            {
                return filePath;
            }&lt;br /&gt;
        }&lt;br /&gt;

public void CTRL25_19_Clicked(object sender, ClickedEventArgs e)&lt;br /&gt;
        {
            Outlook.Application oApplication = new Outlook.Application();&lt;br /&gt;
            Outlook.MailItem newMail = (Outlook.MailItem)oApplication.CreateItem(Outlook.OlItemType.olMailItem);&lt;br /&gt;
            filePath = CreatePDF();&lt;br /&gt;
            XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;br /&gt;
            XPathNavigator xnCPField = xnDoc.SelectSingleNode(&amp;quot;/my:XXXXXXXXXXXXXX/my:XXXXXXx/my:XXXXXXXx&amp;quot;, this.NamespaceManager);&lt;br /&gt;
            XPathNavigator xnMyField = xnDoc.SelectSingleNode(&amp;quot;/my:XXXXXXXXXXXXXXXxx/my:XXXXXX/my:XXXXXX&amp;quot;, this.NamespaceManager);&lt;br /&gt;
            
            newMail.To = xnCPField.Value;&lt;br /&gt;
            newMail.CC = xnMyField.Value;&lt;br /&gt;
            newMail.Subject = &amp;quot;Please approve &amp;quot;;&lt;br /&gt;
             
             newMail.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;&lt;br /&gt;
             newMail.HTMLBody  = &amp;quot;Dear Customer &lt;br /&gt;&lt;br /&gt; Thanks &amp;quot;;&lt;br /&gt;
            newMail.Attachments.Add(filePath, Outlook.OlAttachmentType.olByValue, 1, &amp;quot;Form&amp;quot;);&lt;br /&gt;
            newMail.Display(true);&lt;br /&gt;
}&lt;br /&gt;

Issue :   Clients  who are having infopath 2007 are working fine but who are having infopath 2010 getting error screenshot which is attached to post... &lt;br /&gt;
Please resolve the issue asap.&lt;br /&gt;

thanks,
VR</description></item></channel></rss>