Click to Rate and Give Feedback

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
View.Name Property (Microsoft.Office.Interop.InfoPath.SemiTrust)
Gets the name of the view.

This property is not CLS-compliant.  

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)

Visual Basic (Declaration)
<DispIdAttribute(1)> _
ReadOnly Property Name As String
Visual Basic (Usage)
Dim instance As View
Dim value As String

value = instance.Name
C#
[DispIdAttribute(1)] 
string Name { get; }

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

NoteImportant:

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.

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:

C#
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);
}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker