次の方法で共有


_XDocument2.View Property

Gets a reference to the ViewObject associated with a form.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property View As ViewObject
    Get
'Usage
Dim instance As _XDocument2
Dim value As ViewObject

value = instance.View
ViewObject View { get; }

Property Value

Type: Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObject

Implements

_XDocument.View

Remarks

The ViewObject object that the View property accesses represents the view that is currently active in an InfoPath form. After you have set a reference to the ViewObject object, you can access any of its properties and methods to programmatically interact with the view.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the View property of the XDocument object is used to set a reference to the View object; then, using the Name property of the ViewObject object, it displays the name of the view in a message box:

thisXDocument.UI.Alert("View name: " + thisXDocument.View.Name);

See Also

Reference

_XDocument2 Interface

_XDocument2 Members

View Overload

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace