<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/96863.aspx</link><pubDate>Thu, 03 Apr 2014 18:52:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96863</guid><dc:creator>nilagiri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96863.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=96863</wfw:commentRss><description>&lt;p&gt;Rob, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Do I nedd to write this code on form load event or is there any other way?&lt;/p&gt;
&lt;p&gt;Can I develop any console app &amp;nbsp;to open up form from c drive and then update the field values?&lt;/p&gt;
&lt;p&gt;I do not want to use code behind since form does not support any code behind or data connections&amp;nbsp;when&amp;nbsp;we publish to email recipients.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Please let me know if you have any idea to accomplish this task.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/32067.aspx</link><pubDate>Mon, 08 Sep 2008 15:22:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32067</guid><dc:creator>mkoram</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32067.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32067</wfw:commentRss><description>&lt;p&gt;Hey David,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am facing a similar problem can you please guide me through the following issues:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- I have an aspx page with some fields which will be populated with values from a database. At the end there is a button which when clicked should open an Infopath form with all the values from the aspx page. Can you please provide with any available code snippets!!!&lt;/p&gt;
&lt;p&gt;- Also, Is it possible to have a pop-up window or a panel in infopath form&amp;nbsp;which will be visible only when a particular button is clicked? Because one of the fields in the infopath form will get its value based on the value selected from the pop-up window or the panel.&lt;/p&gt;
&lt;p&gt;I am relatively new in Infopath Development and I am stuck with this issue. Can you please help me out!!!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks a lot in advance!!!&lt;/p&gt;</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3947.aspx</link><pubDate>Tue, 06 Mar 2007 14:58:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3947</guid><dc:creator>eric_formark</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3947.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3947</wfw:commentRss><description>I just tried and my this.Application doesn't match with the MSDN documentation, i.e. several documented properties and methods are unavailable. From InfoPath 2007, I picked Tools/Programming/Loading Event, which opens VSTA (VS2005). When I inspect this.Application, I only get these:&lt;br /&gt;&lt;br /&gt;Properties:&lt;br /&gt;- Environment&lt;br /&gt;- Name&lt;br /&gt;- User&lt;br /&gt;&lt;br /&gt;Methods:&lt;br /&gt;- Equals&lt;br /&gt;- GetHashCode&lt;br /&gt;- GetType&lt;br /&gt;- ToString&lt;br /&gt;&lt;br /&gt;I checked 'this' and it's indeed of the XmlFormHost type. I think what I'm doing is davidair's option #1, but it doesn't seem to work... Any ideas?</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3946.aspx</link><pubDate>Thu, 15 Feb 2007 23:26:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3946</guid><dc:creator>tbrentlong</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3946.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3946</wfw:commentRss><description>Rob,&lt;br /&gt;&lt;br /&gt;It is possible to do what you're trying to do without using the 2003 Compatible OM.  &lt;br /&gt;&lt;br /&gt;//get the path to your new form.&lt;br /&gt;string strNewFormPath = "C:\YourNewForm.xsn";&lt;br /&gt;&lt;br /&gt;XmlForm objNewForm = this.Application.XmlForms.NewFromFormTemplate(strNewFormPath);&lt;br /&gt; &lt;br /&gt;//Find the node in the new form that you want to set&lt;br /&gt;XPathNavigator objTargetField = objNewForm.MainDataSource.CreateNavigator().SelectSingleNode("//whatever the xpath is"), objNewForm.NamespaceManager);&lt;br /&gt; &lt;br /&gt;//Set its value to whatever it needs to be&lt;br /&gt;objTargetField.SetValue("some value");&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Hope this helps.</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3945.aspx</link><pubDate>Sat, 03 Feb 2007 20:11:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3945</guid><dc:creator>davidair</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3945.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3945</wfw:commentRss><description>Hello Rob,&lt;br /&gt;&lt;br /&gt;InfoPath 2007 comes with a new Object Model so by default, you will not see thisXDocument or thisApplication. It is still possible to use the old 2003 OM if you choose to. However, before going into this, could you please tell me how your code will be interacting with InfoPath? In IP2007, there are three ways:&lt;br /&gt;&lt;br /&gt;1. Your code is running of an InfoPath form.&lt;br /&gt;2. Your code is running in a separate application and you externally automate InfoPath.&lt;br /&gt;3. (new in IP2007) Your code is running in a WinForms application and you are hosting an InfoPath control.&lt;br /&gt;&lt;br /&gt;For #1, you have an option of either using the old OM (make sure you design a form without checking the "Enable browser-compatible features only", then go to Tools  |Form Options | Programming  and select "C# (InfoPath 2003 Compatible)" in the Form Template code language dropdown. Then the generated code will contains thisApplication.&lt;br /&gt;On the other hand, it is preferable to use the new OM. Then you will be using this.Application instead of thisApplication (this will refer to the XmlFormHost object instance). However I am not sure how to open a new form in the new OM (check the MSDN documentation for IP2007 here:&lt;a target="_blank" href=http://msdn2.microsoft.com/en-us/library/bb187369.aspx&gt;http://msdn2.microsoft.com/en-us/library/bb187369.aspx&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;For #2, create a simple .NET application, add references to Microsoft.Office.Interop.InfoPath and Microsoft.Office.Interop.InfoPath.Xml and then you can launch InfoPath, open a form and edit a field value in three lines of code:&lt;br /&gt;ApplicationClass infoPathApplication = new ApplicationClass();&lt;br /&gt;XDocument document = infoPathApplication.XDocuments.NewFromSolution(yourXsnPath);&lt;br /&gt;document.DOM.selectSingleNode(someXPath).text = someValue;&lt;br /&gt;&lt;br /&gt;For #3, add a Microsoft.Office.InfoPath.FormControl to your WinForm. You can then call NewFromFormTemplate() on the form control to load an XSN (you can provide a stream to your XML instance as well) and then you can programmatically change the values via formControl.XmlForm.MainDataSource.&lt;br /&gt;&lt;br /&gt;Hope that helps!</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3944.aspx</link><pubDate>Fri, 02 Feb 2007 20:32:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3944</guid><dc:creator>robvettor@hotmail.com</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3944.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3944</wfw:commentRss><description>Patrick and Jim...&lt;br /&gt;&lt;br /&gt;Thk for the quick response.&lt;br /&gt;&lt;br /&gt;When you say, "Create an InfoPath Project," are you referring to an InfoPath form template project (VS 2005, under Visual C#, Office, ...)?&lt;br /&gt;&lt;br /&gt;If so, not seeing the _StartUp Method.&lt;br /&gt;&lt;br /&gt;Again, thx in advance for your help.&lt;br /&gt;&lt;br /&gt;(by the way, do you know of a good example that might demonstrate how to programmatically open form in managed code and populate values?)&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3943.aspx</link><pubDate>Fri, 02 Feb 2007 19:37:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3943</guid><dc:creator>jimbob</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3943.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3943</wfw:commentRss><description>'thisApplication' is assigned inside the _Startup method which is generated when you create a new InfoPath project.&lt;br /&gt;&lt;br /&gt;		public void _Startup(Microsoft.Office.Interop.InfoPath.SemiTrust.Application app, XDocument doc)        &lt;br /&gt;		{&lt;br /&gt;			thisXDocument = doc;&lt;br /&gt;			thisApplication = app;&lt;br /&gt;&lt;br /&gt;			// You can add additional initialization code here.&lt;br /&gt;		}&lt;br /&gt;</description></item><item><title>Re: Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/3942.aspx</link><pubDate>Fri, 02 Feb 2007 19:29:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3942</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3942.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3942</wfw:commentRss><description>Hi Rob and welcome to our forum!&lt;br /&gt;I have sent e-mail out to our developers and hopefully we'll have an answer soon. This is an easy question. You need to use the InfoPath object model and once you have added a reference to that, you should be able to reference it. There is a method called NewFromSolution I think that allows you to specify the solution with an xml file that will prepopulate.</description></item><item><title>Programmatically Opening InfoPath 2007 Form</title><link>https://www.infopathdev.com:443/forums/thread/1833.aspx</link><pubDate>Fri, 02 Feb 2007 19:13:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1833</guid><dc:creator>robvettor@hotmail.com</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1833.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1833</wfw:commentRss><description>Completely new to the InfoPath World.&lt;br /&gt;&lt;br /&gt;Trying to programmatically open an InfoPath 2007 form and programmatically populate values, all in Visual Studio 2005 using c#.&lt;br /&gt;&lt;br /&gt;Keep seeing reference to 'thisApplication' in the examples, but am confused as how to instantiate.&lt;br /&gt;&lt;br /&gt;Any guidance would be greatly appreciated.&lt;br /&gt;&lt;br /&gt;In fact, if anybody has link to sample code that demonstrates the above, that would be wonderful.&lt;br /&gt;&lt;br /&gt;Thanks in advance, &lt;br /&gt;Rob Vettor</description></item></channel></rss>