Share via


View2.Name property

Gets the name of the view.

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

Syntax

'Declaration
ReadOnly Property Name As String
    Get
'Usage
Dim instance As View2
Dim value As String

value = instance.Name
string Name { get; }

Property value

Type: System.String

Implements

View.Name

Remarks

To determine the default view use the IsDefault property of the ViewInfoObject object.

Examples

In the following example the Name property of the ViewObject object is used to determine which view the user has switched to. If the view is the "Archive Customer" view, a note value is added to the form's underlying XML document:

if (thisXDocument.View.Name == @"Archive Customer")
{
 IXMLDOMNode notes = thisXDocument.DOM.selectSingleNode(@"/Customers/CustomerInfo/Notes");
 IXMLDOMNode div = thisXDocument.DOM.createNode(1, "div", @"http://www.w3.org/1999/xhtml");

 div.text = "Note recorded " + thisXDocument.Util.Date.Now().ToString();
 notes.appendChild(div);
}

See also

Reference

View2 interface

View2 members

Name overload

Microsoft.Office.Interop.InfoPath namespace