全部显示

FullPath 属性

       

FullPath 属性返回一个包含被引用类型库的路径和文件名称的字符串

expression.FullPath

expression  必需。返回“Applies To”列表中的一个对象的表达式。

说明

FullPath 属性仅在使用 Visual Basic 时才可用,并且是只读属性。

类型库将保存在文件中,下表显示了包含类型库的常用文件扩展名:

文件扩展名 文件类型
.olb、.tlb 类型库文件
.adp、.ade、.mdb、.mda、.mde 数据库
.exe、.DLL 可执行文件
.ocx ActiveX 控件
 

如果 Reference 对象的 IsBroken 属性设为 True,读取 FullPath 属性将产生错误。

示例

下面的示例将打印 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