-
Notifications
You must be signed in to change notification settings - Fork 7
/
WindowObject.xml
58 lines (56 loc) · 4.58 KB
/
WindowObject.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<Type Name="WindowObject" FullName="Microsoft.Office.Interop.InfoPath.WindowObject">
<TypeSignature Language="C#" Value="public interface WindowObject : Microsoft.Office.Interop.InfoPath.Window2" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract WindowObject implements class Microsoft.Office.Interop.InfoPath.Window2" />
<TypeSignature Language="DocId" Value="T:Microsoft.Office.Interop.InfoPath.WindowObject" />
<TypeSignature Language="VB.NET" Value="Public Interface WindowObject
Implements Window2" />
<TypeSignature Language="C++ CLI" Value="public interface class WindowObject : Microsoft::Office::Interop::InfoPath::Window2" />
<TypeSignature Language="F#" Value="type WindowObject = interface
 interface Window2" />
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Microsoft.Office.Interop.InfoPath.Window2</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.CoClass(typeof(Microsoft.Office.Interop.InfoPath.WindowObjectClass))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.Guid("096CD5F7-0786-11D1-95FA-0080C78EE3BB")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a window that is used in the Microsoft Office InfoPath 2003 application.</summary>
<remarks>
<para>This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see<see cref="T:Microsoft.Office.Interop.InfoPath.Window2" />.</para>
<para>The <b>WindowObject</b> objects represent the two types of windows that are used in the InfoPath application: 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.</para>
<para>The <b>WindowObject</b> object provides a number of properties and methods that can be used to programmatically interact with InfoPath windows, including the ability to activate or close a window and the ability to interact with the task panes and command bars that they contain. The <b>WindowObject</b> object also provides a property for accessing the form's underlying XML document that is associated with the window.</para>
<para>The <b>WindowObject</b> objects of an InfoPath form are accessed through the <see cref="P:Microsoft.Office.Interop.InfoPath.Windows.Item(System.Object)" /> property. The type of window can be determined by using the <see cref="P:Microsoft.Office.Interop.InfoPath.Window.WindowType" /> property.</para>
<para>You can access the currently open window directly by using the <see cref="P:Microsoft.Office.Interop.InfoPath._Application2.ActiveWindow" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.Application" /> object, without going through the <see cref="T:Microsoft.Office.Interop.InfoPath.WindowsCollection" /> collection. You can also access the <b>WindowObject</b> object that is associated with a view by using the <see cref="P:Microsoft.Office.Interop.InfoPath.View.Window" /> property.</para>
<para>
<b>Note</b>: Some properties of the <b>WindowObject</b> object are only available when using the editing window type; they will return an error if used with the designing window type.</para>
<para />
</remarks>
<example>
<para>In the following example, implemented as an <b>OnClick</b> event handler for a button control, the <b>ActiveWindow</b> property is used to set a reference to the current window. Then the code checks the window type; if it is the editing window type, it displays the number of task panes contained in the window in a message box.</para>
<code>public void WindowObject_OnClick(DocActionEvent e)
{
Window2 activeWindow;
// Set a reference to the current window.
activeWindow = thisApplication.ActiveWindow;
// Check that the window is an editing window type.
if (activeWindow.WindowType == XdWindowType.xdEditorWindow)
{
// Display the number of task panes in the window.
thisXDocument.UI.Alert("Number of task panes: " +
activeWindow.TaskPanes.Count);
}
}</code>
<para>For code examples, see How to: Work with Form Windows Using the InfoPath 2003 Object Model.</para>
</example>
</Docs>
<Members />
</Type>