<?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>Automating Infopath 2007 Form Printing From VS2005 C# Windows Application</title><link>https://www.infopathdev.com:443/forums/thread/31446.aspx</link><pubDate>Wed, 13 Aug 2008 20:16:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31446</guid><dc:creator>Jeff S</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31446.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31446</wfw:commentRss><description>&lt;p&gt;I have written a routine in a VS2005 C# Windows form application to print a group of InfoPath 2007 forms. It works, but it looks clumsy because the Infopath application window is being opened in a maximized state. Is there a way to hide or minimize the Infopath application window?&lt;/p&gt;
&lt;p&gt;The following is an snipet of the code:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Create an instance of the InfoPath Application&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;IP.&lt;font color="#2b91af" size="2"&gt;ApplicationClass &lt;/font&gt;InfoPathApp = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; IP.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ApplicationClass&lt;/font&gt;&lt;font size="2"&gt;(); &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;IP.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;XDocument&lt;/font&gt;&lt;font size="2"&gt; myXdoc = InfoPathApp.XDocuments.NewFromSolution(sFormTemplate);&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;myXdoc.PrintOut();&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; objDoc = InfoPathApp.XDocuments[0];&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;InfoPathApp.XDocuments.Close(objDoc);&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>