适用对象
引用对象 |
Reference 对象的 GUID 属性返回一个 GUID,标识 Windows 注册表中的类型库。 字符串型,只读。
表达式.Guid
表达式 必需。 返回“适用范围”列表中的对象之一的表达式。
备注
仅当使用 Visual Basic for Applications (VBA) 代码时,GUID 属性才可用。
每个类型库都有一个关联的 GUID 保存在注册表中。 设置对类型库的引用时,Microsoft Office Access 2007 使用类型库的 GUID 来标识类型库。
可使用 AddFromGUID 方法从类型库的 GUID 创建 Reference 对象。
示例
下面的示例将打印 References 集合中每个 Reference 对象的 FullPath、GUID、IsBroken、Major 和 Minor 属性值:
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