<?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: Change the caption of the InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/3131.aspx</link><pubDate>Fri, 01 Sep 2006 17:52:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3131</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3131.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3131</wfw:commentRss><description>Yes, the OnContextChange is fired after OnLoad... it occurs when the view has been drawn completely (keep in mind the View object doesn't even exist during OnLoad--it is created and rendered afterward). Once the view is drawn, the initial context is set, thus firing the very first OnContextChange event.&lt;br /&gt;&lt;br /&gt;Here's what I had to do to get the custom caption to stay:&lt;br /&gt;&lt;br /&gt;1. Set a global variable: SetCaption = 0;&lt;br /&gt;2. In the OnContextChange event handler, check: if(SetCaption &amp;lt; 2) { SetCaption++; Application.ActiveWindows.Caption = "Custom Caption"; }&lt;br /&gt;&lt;br /&gt;That seemed to do the trick. The initial caption change in OnContextChange was lost, but the second change remained.&lt;br /&gt;&lt;br /&gt;Good luck!</description></item><item><title>Re: Change the caption of the InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/3130.aspx</link><pubDate>Fri, 01 Sep 2006 07:58:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3130</guid><dc:creator>larniel</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3130.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3130</wfw:commentRss><description>Hi Greg,&lt;br /&gt;&lt;br /&gt;I made a simple template as following:&lt;br /&gt;1. one button and one text box.&lt;br /&gt;2. JS codes are:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function XDocument::OnLoad(eventObj)&lt;br /&gt;{&lt;br /&gt;	Application.ActiveWindow.Caption = "Hello World";&lt;br /&gt;}&lt;br /&gt;function CTRL1_5::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;	Application.ActiveWindow.Caption = "Hello World again by Clicking";&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Every time the form is opened by either previewing or double clicking the template, the captical is "Preview1" or "Form1" correspondingly. After the button is clicked, it's changed to "Hello World by Clicking", and focus swiching between button and text box or inputting in the text box doesn't reflect the capital.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then I added/modified the JS codes like:&lt;br /&gt;&lt;pre&gt;&lt;b&gt;var ii;&lt;/b&gt;&lt;br /&gt;function XDocument::OnLoad(eventObj)&lt;br /&gt;{&lt;br /&gt;	Application.ActiveWindow.Caption = "Hello World";&lt;br /&gt;	&lt;b&gt;ii = 0;&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;function CTRL1_5::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;	Application.ActiveWindow.Caption = "Hello World again by Clicking";&lt;br /&gt;}&lt;br /&gt;&lt;b&gt;function XDocument::OnContextChange(eventObj)&lt;br /&gt;{&lt;br /&gt;	ii++;&lt;br /&gt;	Application.ActiveWindow.Caption = "Hello World " + ii;&lt;br /&gt;}&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now every time when the form is displayed in "filling" mode, the capital is "Hello World 1". When the focus is changed, the count is added, and when the button is clicked after it just gets the focus, the capital will first be "Hello World by Clicking" then immediately changes to "Hello World *".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From the above, maybe I can say that event OnContextChange is triggered right after OnLoad. However, the default OnContextChange will set the capital to its initial form, namely "Preview*" for previewing and "Form*" for filling.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by Greg Collins&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Its probably no surprise for previewing, but you'll need to find out what is triggering the title change in your live form and then reset the title to your text when that trigger occurs.&lt;br /&gt;&lt;br /&gt;I have seen this feature, but never used it--so I was unaware that InfoPath would change it back after setting it.&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;</description></item><item><title>Re: Change the caption of the InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/3129.aspx</link><pubDate>Wed, 30 Aug 2006 20:25:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3129</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3129.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3129</wfw:commentRss><description>Its probably no surprise for previewing, but you'll need to find out what is triggering the title change in your live form and then reset the title to your text when that trigger occurs.&lt;br /&gt;&lt;br /&gt;I have seen this feature, but never used it--so I was unaware that InfoPath would change it back after setting it.</description></item><item><title>Re: Change the caption of the InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/3128.aspx</link><pubDate>Tue, 29 Aug 2006 20:51:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3128</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3128.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3128</wfw:commentRss><description>I'm not sure that you'll be able to do this.  You might try adding that line of code in the OnContextChange event handler so that the new title bar is constantly overwritten.  This might affect performance and it is kind of a hack but it should accomplish this.</description></item><item><title>Change the caption of the InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/1532.aspx</link><pubDate>Tue, 29 Aug 2006 15:49:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1532</guid><dc:creator>larniel</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1532.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1532</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I'd like to customized the caption of the form, e.g. "Absence Request form of **** Co. Ltd."&lt;br /&gt;In the XDocument:OnLoad() I write&lt;br /&gt;&lt;pre&gt;Application.ActiveWindow.Caption = "Absence Request form of **** Co. Ltd.";&lt;/pre&gt;&lt;br /&gt;When the form is just opened, the caption displays properly. However, it's soon changed to "Form1" (in case of double clicking the templat) or "Preview1" (in case of preview when designing the form).&lt;br /&gt;&lt;br /&gt;Any suggestion?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!</description></item></channel></rss>