次の方法で共有


View2.Name プロパティ

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

このプロパティは、CLS に準拠していません。  

名前空間: Microsoft.Office.Interop.InfoPath.SemiTrust
アセンブリ: Microsoft.Office.Interop.InfoPath.SemiTrust (microsoft.office.interop.infopath.semitrust.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.SemiTrust 名前空間