CurrentProject.IsTrusted 屬性 (Access)
取得目前專案中是否已啟用宏和 Visual Basic for Applications (VBA) 程式碼。 唯讀的 Boolean。
語法
運算式。IsTrusted
表達 代表 CurrentProject 物件的變數。
範例
下列範例示範如何在宏中使用 IsTrusted 屬性來判斷是否已在啟用信任時開啟資料庫。 如果已啟用信任,則會呼叫 Visual Basic for Applications (VBA) 副程式 Init 。 否則,使用者會收到已在停用模式下開啟資料庫的通知。
If [currentproject].[istrusted] Then
RunCode
Function Name =Init()
Else
MessageBox
Message The application is opened in disabled mode. Please enable the application for full functionality.
Beep Yes
Type None
Title Disabled Mode Check
End If
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應