次の方法で共有


_XDocument3.DOM プロパティ

XML ドキュメント オブジェクト モデル (DOM) 形式でフォームの基になる XML ドキュメントへの参照を取得します。

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

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

構文

'宣言
<DispIdAttribute(8)> _
ReadOnly Property DOM As IXMLDOMDocument
'使用
Dim instance As _XDocument3
Dim value As IXMLDOMDocument

value = instance.DOM
[DispIdAttribute(8)] 
IXMLDOMDocument DOM { get; }

コメント

XDocument オブジェクトの主要なプロパティである DOM プロパティを使用すると、フォームのソース XML へのアクセスおよび操作をプログラムで行うことができます。フォームのソース XML データが含まれている XML DOM への参照を設定すると、その XML DOM でサポートされているプロパティおよびメソッドを使用できるようになります。

メモ重要 :

このメンバは、現在開いているフォームと同じドメイン内で実行されているフォーム、またはドメインを越えたアクセス許可を付与されているフォームだけがアクセスできます。

// Retrieve the Employees Adapter from the DataAdapters collection.
ADOAdapter employeesDA =
   (ADOAdapter)thisXDocument.DataAdapters["Employees"];
// Get employee’s ID from the main DOM
string employeeID = 
   thisXDocument.DOM.selectSingleNode("//my:field2").text;
// Change the ADOAdapter’s command to retrieve the record 
// of the Employee's ID entered by the user
employeesDA.Command = 
   "select * from Employees where EmployeeID="+employeeID;
// Get DataObject from the DataObjects collection and 
// call Query to refresh the data object.
DataSourceObject employeesDO =
   (DataSourceObject)thisXDocument.DataObjects["Employees"];
employeesDO.Query();

関連項目

参照

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