|
|
Библиотечные Ссылки (Referenses) - Отображение в Immediate окне списка подключенных библиотечных ссылок
Private Sub ShowReferenses()
Dim ref As Reference
Dim i As Integer
For Each ref In References
i = i + 1
Debug.Print Format(i, "00") & " - " & ref.Name & vbCrLf & _
" - Путь: " & ref.FullPath & vbCrLf & _
" - Версия: " & ref.Major & "." & ref.Minor & _
" - GUID: " & ref.GUID & vbCrLf & _
" - Встроенная: " & ref.BuiltIn & vbCrLf & _
" - Ссылка ""отвалилась?"" : " & ref.IsBroken & vbCrLf & _
"-----------------------------------------------------"
Next ref
End Sub
Private Sub ShowReferenses()
Dim ref As Reference
Dim i As Integer
Dim s$, FilePath$
Dim b As Boolean
s = "-----------------------------------------------------------------" & vbCrLf
s = s & CurrentProject.Name & vbCrLf
s = s & "-----------------------------------------------------------------" & vbCrLf
For Each ref In References
i = i + 1
s = s & Format(i, "00") & " - " & ref.Name & vbCrLf & _
" - Путь: " & ref.FullPath & vbCrLf & _
" - Версия: " & ref.Major & "." & ref.Minor & _
" - GUID: " & ref.Guid & vbCrLf & _
" - Встроенная: " & ref.BuiltIn & vbCrLf & _
" - Ссылка ""отвалилась?"" : " & ref.IsBroken & vbCrLf & _
"-----------------------------------------------------------------" & vbCrLf
Next ref
Debug.Print s
FilePath = CurrentProject.Path & "\" & _
Mid(CurrentProject.Name, 1, Len(CurrentProject.Name) - 6) & " - Библиотечные ссылки.txt"
b = SaveStringAsTXT(FilePath, s)
If b = True Then
Debug.Print "Отчёт сохранён как:" & vbCrLf & FilePath & vbCrLf & _
"-----------------------------------------------------------------"
End If
End Sub
Public Function SaveStringAsTXT(ByVal FlilePath$, ByVal s_text$) As Boolean
Dim fso As Object
Dim ts As Object
On Error GoTo SaveStringAsTXT_Err
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.CreateTextFile(FlilePath, True)
ts.Write s_text
ts.Close
SaveStringAsTXT = True
SaveStringAsTXT_Bye:
Set ts = Nothing: Set fso = Nothing
Exit Function
SaveStringAsTXT_Err:
MsgBox "Ошибка " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"в процедуре: SaveStringAsTXT", vbCritical, "Error!"
Resume SaveStringAsTXT_Bye
End Function
|
|