DoCmd.TransferSharePointList 方法 (Access)

使用 TransferSharePointList 方法可從 SharePoint Foundation 網站匯入或鏈接數據。

語法

表達式TransferSharePointList (TransferTypeSiteAddressListIDViewIDTableNameGetLookupDisplayValues)

expression 代表 DoCmd 物件的變數。

參數

名稱 必要/選用 資料類型 描述
TransferType 必要項目 AcSharePointListTransferType AcSharePointListTransferType 常數,指定要進行的傳輸類型。
SiteAddress 必要 變數 SharePoint 網站的完整路徑。
ListID 必要 變數 要傳輸之清單的名稱或 GUID。
ViewID 選用 Variant 您想要使用之清單的檢視 GUID。 若要傳輸清單中的所有資料列及資料行,請將這個引數保留為空白。
TableName 選用 變數 要在 Access 中為資料表或連結資料表顯示的名稱。
GetLookupDisplayValues 選用 Variant 指定是否要傳輸 查閱 欄位的顯示值,而不是用來執行查閱的標識碼。

註解

此方法的效果與在 [外部數據] 索引標籤的 [入] 群組中選擇 [SharePoint 列表] 相同。動作的自變數會對應至您在取得外部數據精靈中所做的選擇。

如果您指定的清單或檢視不存在,並不會發生任何錯誤,也不會傳輸任何資料。

GUID 是清單或檢視唯一的十六進位識別碼。 輸入 GUID 時必須使用下列格式,其中每個 "F" 都代表十六進位數字 (0 到 9 或 A 到 F)。

{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}

您可以使用下列程序,從 SharePoint 網站取得清單或檢視的 GUID:

  1. 開啟 SharePoint Foundation 中的清單。

  2. 如果未顯示您想要的檢視,請按兩下 [ 檢視 ] 下拉式箭號,然後選取您想要的檢視。

  3. 選擇 [ 檢視] 下拉式箭號,然後選取 [ 修改此檢視]。 瀏覽器網址列中的位址包含清單和檢視的 GUID。 The GUID for the list follows List=, and the GUID for the view follows View=. However, in the address, each { (left brace) character is represented by the string %7B, each - (hyphen) character is represented by the string %2D, and each } (right brace) character is represented by the string %7D. 例如:

    https://MySite12/_layouts/ViewEdit.aspx?List=%7B2A82A404%2D5529%2D47DC%2DAE13%2DAC1D9BC0A84F%7D&View=%7B357B4FE6%2D44CF%2D4275%2DB91F%2D46558301579B%7D

    在此宏指令中,您必須以 {字元取代每個 %7B 字串、將每個 %2D 字串-取代為字元,並將每個 %7D 字串取代為 } 字元,才能使用位址中的 GUID 做為自變數。 請 勿在清單 GUID 的 %7D 字串後面包含&(連字元) 字元。

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應