取得目前專案中是否已啟用巨集和 Visual Basic for Applications (VBA) 程式碼。 唯讀的 Boolean。
語法
表達。是可信的
詞 代表 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 支援與意見反應。