次の方法で共有


View2.Name プロパティ

ビューの名前を取得します。

名前空間: Microsoft.Office.Interop.InfoPath
アセンブリ: Microsoft.Office.Interop.InfoPath (microsoft.office.interop.infopath.dll 内)

構文

'宣言
<DispIdAttribute(1)> _
ReadOnly Property Name As String
'使用
Dim instance As View2
Dim value As String

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

コメント

既定のビューを指定するには、ViewInfoObject オブジェクトの IsDefault プロパティを使用します。

次の例では、ViewObject オブジェクトの Name プロパティを使用して、ユーザーが切り替えたビューを指定します。"Archive Customer" ビューに切り替えた場合、フォームの基になる XML ドキュメントに Notes の値が追加されます。

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);
}

関連項目

参照

View2 インターフェイス
View2 のメンバ
Microsoft.Office.Interop.InfoPath 名前空間