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 支援與意見反應