Reference 對(duì)象的 Major 屬性返回一個(gè)只讀的 Long 值,標(biāo)識(shí)引用的應(yīng)用程序的主版本號(hào)。
expression.Major
expression 必需。返回“應(yīng)用于”列表中的一個(gè)對(duì)象的表達(dá)式。
Major 屬性僅在使用 Visual Basic 時(shí)使用。
Major 屬性返回版本號(hào)中的十進(jìn)制小數(shù)點(diǎn)左邊的值。例如,如果已經(jīng)設(shè)置了對(duì)版本號(hào)為 2.5 的應(yīng)用程序的引用,Major 屬性將返回 2。
下面的示例將顯示一條消息,包含當(dāng)前項(xiàng)目中所有引用的有關(guān)信息。
Dim r As Reference
Dim strInfo As String
For Each r In Application.References
strInfo = strInfo & r.Name & " " & r.Major & "." & r.Minor & vbCrLf
Next
MsgBox "Current References: " & vbCrLf & strInfo