FullPath 屬性

此頁沒有內(nèi)容條目
內(nèi)容

expandtri全部顯示

FullPath 屬性返回一個包含被引用類型庫的路徑和文件名稱的字符串。

expression.FullPath

expression    必需。返回“應(yīng)用于”列表中的一個對象的表達(dá)式。

說明

FullPath 屬性僅在使用 Visual Basic 時才可用,并且是只讀屬性。

類型庫將保存在文件中,下表顯示了包含類型庫的常用文件擴展名:

文件擴展名

文件類型

.olb、.tlb

類型庫文件

.adp、.ade、.mdb、.mda、.mde

數(shù)據(jù)庫

.exe、.DLL

可執(zhí)行文件

.ocx

ActiveX 控件

如果 Reference 對象的 IsBroken 屬性設(shè)為 True,讀取 FullPath 屬性將產(chǎn)生錯誤。

示例

下面的示例將打印 References 集合內(nèi)每個 Reference 對象的 FullPath、GUIDIsBroken、MajorMinor 屬性值:

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