共用方式為


Folder.IsSharePointFolder (Outlook)

會傳回 Boolean,可判斷資料夾是否為 Microsoft SharePoint Foundation 資料夾。 唯讀。

語法

expressionIsSharePointFolder

一個代表 資料夾 物件的變數。

註解

SharePoint Foundation 資料夾是 Outlook 中的自訂資料夾,其中含有存在 SharePoint Foundation 網站上之連絡人清單或事件清單的即時複本。 此連絡人清單會對應至 Outlook 中的 [連絡人] 資料夾,而事件清單會對應至 [行事曆] 資料夾。

當從 SharePoint Foundation 網站匯出聯絡人清單或事件清單時,SharePoint Foundation 資料夾會自動在導覽窗格的 SharePoint 資料夾 節點下建立。

雖然 SharePoint Foundation 資料夾的運作方式與其他資料夾很相似,不過仍有少數例外。 SharePoint Foundation 資料夾是唯讀的,而且任何嘗試編輯資料夾屬性或加入、編輯或移除現有項目的動作將會失敗。

使用者 Microsoft Exchange 伺服器資料夾中的資料夾永遠不會是 SharePoint Foundation 資料夾,而使用者預設的個人資料夾檔案 (.pst) 中也不會有資料夾是 SharePoint Foundation 資料夾。 通常 SharePoint Foundation 資料夾會位於導覽窗格的 SharePoint 資料夾 節點下方。

範例

下列 Microsoft Visual Basic for Applications (VBA) 範例會變更使用中檢閱程式內顯示之約會項目的主旨列並儲存此項目。 如果此項目包含在 SharePoint Foundation 資料夾中,它就會為使用者顯示一則訊息,表示無法修改項目。 若要執行此範例,請確定在使用中檢閱程式視窗內會顯示一個約會項目。 這則範例將會修改約會項目的主旨。

Sub ChangeItem() 
 
'Checks if the item is contained in a SharePoint folder. If it is not, it changes the Subject line, and then saves the item. 
 
 Dim myItem As Outlook.AppointmentItem 
 
 Dim fldFolder As Outlook.Folder 
 
 
 
 Set myItem = Application.ActiveInspector.CurrentItem 
 
 Set fldFolder = myItem.Parent 
 
 If fldFolder.IsSharePointFolder = True Then 
 
 MsgBox _ 
 
 "The item is contained in a SharePoint Foundation folder and cannot be modified." 
 
 Else 
 
 myItem.Subject = myItem.Subject + " Changed by VBA" 
 
 myItem.Save 
 
 MsgBox "The item has been changed." 
 
 End If 
 
End Sub

另請參閱

資料夾物件

支援和意見反應

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