File: inconWorkingWithFormWindows.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (12 lines) | stat: -rw-r--r-- 9,887 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01039909"><META NAME="lcid" CONTENT="1033"><title>Working with form windows</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>Working with form windows</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>When working programmatically with a Microsoft Office InfoPath 2003 form, you can write scripting code to access the form's windows, and then customize some of the items that they contain. The InfoPath object model supports access to a form's windows through the use of the <b class="bterm"><a href="xdobjWindow.htm" id="HV01021252" lcid=" ">Window</a></b> object in association with the <b class="bterm"><a href="xdcolWindows.htm" id="HV01021189" lcid=" ">Windows</a></b> collection.</p><p>There are two types of windows in an InfoPath form: the editing window that is used as the form area when  a user fills out a form, and the designing window that is used as the design mode when a user designs a form. When writing scripting code in a form, it is the editing window that provides the most useful functionality, because you can use the <b class="bterm">Window</b> object associated with it to access a variety of properties and methods that can be used to customize a form.</p><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Overview of the Windows collection</a></p><div id="ExpCol" class="collapsed" border="0"><p>The  <b class="bterm">Windows</b> collection provides the following properties that form developers can use to manage the <b class="bterm">Window</b> objects that it contains.</p><table><tr><th>Name</th><th>Description</th></tr><tr><td><b class="bterm"><a href="xdproCount_2.htm" id="HV01021272" lcid=" ">Count</a></b> property</td><td>Returns a count of the number of <b class="bterm">Window</b> objects contained in the collection</td></tr><tr><td><b class="bterm"><a href="xdproItem_1.htm" id="HV01021294" lcid=" ">Item</a></b> property</td><td>Returns a reference to the specified <b class="bterm">Window</b> object</td></tr></table></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Overview of the Window object</a></p><div id="ExpCol" class="collapsed" border="0"><p>The  <b class="bterm">Window</b> object provides the following methods and properties that form developers can use to interact with an InfoPath window.</p><table><tr><th>Name</th><th>Description</th></tr><tr><td><b class="bterm"><a href="xdmthActivate.htm" id="HV01021374" lcid=" ">Activate</a></b> method</td><td>Designates the window as the currently active window</td></tr><tr><td><b class="bterm"><a href="xdproActive.htm" id="HV01021261" lcid=" ">Active</a></b> property</td><td>Returns a Boolean value indicating whether the window is the currently active window</td></tr><tr><td><b class="bterm"><a href="xdproCaption_HV01104023.htm" id="HV01104023" lcid=" ">Caption Property (Window Object)</a></b> property</td><td>A read/write property that returns or sets the caption text for the window represented by the <b class="bterm"><a href="xdobjWindow.htm" id="HV01021252" lcid=" ">Window</a></b> object</td></tr><tr><td><b class="bterm"><a href="xdmthClose_2.htm" id="HV01021381" lcid=" ">Close</a></b> method</td><td>Closes a window</td></tr><tr><td><b class="bterm"><a href="xdproCommandBars.htm" id="HV01021268" lcid=" ">CommandBars</a></b> property</td><td>Returns a reference to the Microsoft Office <b class="bterm">CommandBars</b> object</td></tr><tr><td><b class="bterm"><a href="xdproHeight_HV01104032.htm" id="HV01104032" lcid=" ">Height</a></b> property</td><td>A read/write property of type long integer that specifies the height of the the window represented by the <b class="bterm">Window</b> object, measured in points</td></tr><tr><td><b class="bterm"><a href="xdproLeft_HV01104039.htm" id="HV01104039" lcid=" ">Left</a></b> property</td><td>A read/write property of type long integer that specifies the horizontal position of the window represented by the <b class="bterm">Window</b> object, measured in points</td></tr><tr><td><b class="bterm"><a href="xdproMailEnvelope.htm" id="HV01021306" lcid=" ">MailEnvelope</a></b> property</td><td>Returns a reference to the <b class="bterm"><a href="xdobjMailEnvelope.htm" id="HV01021244" lcid=" ">MailEnvelope</a></b> object</td></tr><tr><td><b class="bterm"><a href="xdproTaskPanes.htm" id="HV01021341" lcid=" ">TaskPanes</a></b> property</td><td>Returns a reference to the <b class="bterm"><a href="xdcolTaskPanes.htm" id="HV01021187" lcid=" ">TaskPanes</a></b> collection</td></tr><tr><td><b class="bterm"><a href="xdproTop_HV01104052.htm" id="HV01104052" lcid=" ">Top</a></b> property</td><td>A read/write property of type long integer that specifies the vertical position of the window represented by the <b class="bterm">Window</b> object, measured in points</td></tr><tr><td><b class="bterm"><a href="xdproType_1.htm" id="HV01021344" lcid=" ">Type</a></b> property</td><td>Returns a number indicating the type of the window, based on the <b class="bterm"><a href="xdenmXdWindowType.htm" id="HV01025499" lcid=" ">XdWindowType</a></b> enumeration</td></tr><tr><td><b class="bterm"><a href="xdproWidth_HV01104053.htm" id="HV01104053" lcid=" ">Width</a></b> property</td><td>A read/write property of type long integer that specifies the width of the window represented by the <b class="bterm">Window</b> object, measured in points</td></tr><tr><td><b class="bterm"><a href="xdproWindowState_HV01104054.htm" id="HV01104054" lcid=" ">WindowState</a></b></td><td>A read/write property of type <b class="bterm"><a href="xdenmXdWindowState_HV01104066.htm" id="HV01104066" lcid=" ">XdWindowState</a></b> that returns or sets the state of the window represented by the <b class="bterm">Window</b> object</td></tr><tr><td><b class="bterm"><a href="xdproXDocument_1.htm" id="HV01021359" lcid=" ">XDocument</a></b> property</td><td>Returns a reference to the <b class="bterm"><a href="xdobjXDocument.htm" id="HV01021254" lcid=" ">XDocument</a></b> object associated with the window</td></tr></table></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Using the Windows collection and the Window object</a></p><div id="ExpCol" class="collapsed" border="0"><p>The <b class="bterm">Windows</b> collection is accessed through the <b class="bterm"><a href="xdproWindows.htm" id="HV01021357" lcid=" ">Windows</a></b> property of the <b class="bterm"><a href="xdobjApplication.htm" id="HV01021256" lcid=" ">Application</a></b> object. When using the <b class="bterm">Windows</b> collection to access a form's windows, you pass a long integer to the <b class="bterm">Item</b> method to return a reference to a <b class="bterm">Window</b> object. For example, the following code sets a reference to the first <b class="bterm">Window</b> object contained in the Windows <b class="bterm">collection</b>:</p><pre><code>var objWindow;
objWindow = Application.Windows(0);</code></pre><p>However, you can access the currently open window directly by using the <b class="bterm"><a href="xdproActiveWindow.htm" id="HV01021262" lcid=" ">ActiveWindow</a></b> property of the <b class="bterm">Application</b> object, without going through the <b class="bterm">Windows</b> collection, as the following code demonstrates:</p><pre><code>var objWindow;
objWindow = Application.ActiveWindow;</code></pre><p>A <b class="bterm">Window</b> object can also be accessed by using the <b class="bterm"><a href="xdproWindow_2.htm" id="HV01021356" lcid=" ">Window</a></b> property of the <b class="bterm"><a href="xdobjView.htm" id="HV01021249" lcid=" ">View</a></b> object, which is associated with the form's underlying XML document. The <b class="bterm"><a href="xdproView.htm" id="HV01021352" lcid=" ">View</a></b> property of the <b class="bterm">XDocument</b> object is used to access the <b class="bterm">View</b> object. For example, the following code sets a reference to the <b class="bterm">Window</b> object that is associated with the view of a  form's underlying XML document:</p><pre><code>var objWindow;
objWindow = XDocument.View.Window;</code></pre><p><b>Note</b>  Some of the properties and methods of the <b class="bterm">Window</b> object are used only for the editing window type; if used with the designing window type, they will return an error.</p></div><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/inconWorkingWithFormWindows_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>