適用對象

Reference 物件

Reference 物件的 GUID 屬性會傳回用於在 Windows 登錄中識別類型程式庫的 GUID。 唯讀 String

expression.Guid

表達 必要。 一個運算式,該運算式會返回應用程式至清單中的其中一個物件。

備註

GUID 屬性只能在使用 Visual Basic for Applications (VBA) 程式碼時取得。

每個類型程式庫都有關聯的 GUID (儲存在登錄中)。 當您設定類型程式庫的參照時,Microsoft Office Access 2007 會使用類型程式庫的 GUID 來識別類型程式庫。

您可以使用 AddFromGUID 方法根據類型程式庫的 GUID 建立 Reference 物件。

範例

以下範例會將 References 集合物件中每個 Reference 物件的 FullPathGUIDIsBrokenMajorMinor 屬性列印出來:

Sub ReferenceProperties()
Dim ref As Reference
' Enumerate through References collection.
For Each ref In References
' Check IsBroken property.
If ref.IsBroken = False Then
Debug.Print "Name: ", ref.Name
Debug.Print "FullPath: ", ref.FullPath
Debug.Print "Version: ", ref.Major & _
"." & ref.Minor
Else
Debug.Print "GUIDs of broken references:"
Debug.Print ref.GUID
EndIf
Next ref
End Sub

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Office Insiders

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?

Thank you for your feedback!

×