应用对象
Microsoft 365 专属 Access Access 2024 Access 2021 Access 2019 Access 2016

适用对象

引用对象

Reference 对象的 GUID 属性返回一个 GUID,标识 Windows 注册表中的类型库。 字符串型,只读。

表达式.Guid

表达式 必需。 返回“适用范围”列表中的对象之一的表达式。

备注

仅当使用 Visual Basic for Applications (VBA) 代码时,GUID 属性才可用。

每个类型库都有一个关联的 GUID 保存在注册表中。 设置对类型库的引用时,Access 使用类型库的 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

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。