共用方式為


SharepointListAdapterObject 介面

表示 SharePoint 清單或文件庫的連線。

**命名空間:**Microsoft.Office.Interop.InfoPath
**組件:**Microsoft.Office.Interop.InfoPath (於 microsoft.office.interop.infopath.dll 中)

語法

'宣告
<GuidAttribute("096CD69A-0786-11D1-95FA-0080C78EE3BB")> _
<CoClassAttribute(GetType(SharepointListAdapterObjectClass))> _
Public Interface SharepointListAdapterObject
    Inherits SharepointListAdapter
'用途
Dim instance As SharepointListAdapterObject
[GuidAttribute("096CD69A-0786-11D1-95FA-0080C78EE3BB")] 
[CoClassAttribute(typeof(SharepointListAdapterObjectClass))] 
public interface SharepointListAdapterObject : SharepointListAdapter

備註

此類型為 coclass 的包裝函式,屬於 COM 互通性中 Managed 程式碼的必要項。使用此類型,即可存取由此 coclass 實作的 COM 介面成員。如需 COM 介面 (包括其成員說明連結) 的詳細資訊,請參閱 SharepointListAdapter2

SharePointListAdapter 物件代表從 SharePoint 清單或文件庫擷取資料的 Office InfoPath 資料中繼層。

如果是次要資料來源,SharePointListAdapter 物件可透過 DataSourceObject 物件的 QueryAdapter 屬性存取。資料中繼層物件可透過 XDocument 物件的 DataAdapters 屬性存取。

範例

SharepointListAdapter SPList = ((SharepointListAdapter)thisXDocument.DataAdapters[“SharePoint list”]);
thisXDocument.UI.Alert(SPList.SiteUrl);
SPList.Query();

在下列範例中,藉由將資料中繼層物件的名稱傳遞給 DataAdaptersCollection 集合的 QueryAdapter 屬性,並透過資料中繼層物件的 Item 屬性來存取 SharePointListAdapter 物件的參照:

SharepointListAdapter adapter;
adapter = (SharepointListAdapter) thisXDocument.DataAdapters["Announcements"];

在設定參照後,即可使用下列範例所顯示的 SharePointListAdapter 物件之方法,它會重新查詢 SharePoint 清單或程式庫以更新資料中繼層物件的 DOM 屬性:

adapter.Query();

請參閱

參考

SharepointListAdapterObject 成員
Microsoft.Office.Interop.InfoPath 命名空間