Public Sub NameView()
Dim dDoc As DrawingDocument
Set dDoc = ThisApplication.ActiveDocument
Dim sSheet As Sheet
Dim oView As DrawingView
'Set sSheet = dDoc.Sheets.Item(1) 'Обращаемся к первому листу сохраненного чертежа
Dim oName As String '
Dim Arr(115) As String
Dim i As Long
Dim n As Long ' номер добавляемой буквы вида
Dim nList As Long ' номер
Dim ArrS(100) As String ' Название листов в чертеже
n = 0
For Each sSheet In dDoc.Sheets
ArrS(n) = sSheet.Name
n = n + 1
Next
n = 0
For i = 192 To 223
Debug.Print (Chr(i))
If Chr(i) <> "З" And Chr(i) <> "Ь" And Chr(i) <> "Ъ" Then
Arr(n) = (Chr(i))
n = n + 1
End If
Next
For i = 192 To 223
If Chr(i) <> "З" And Chr(i) <> "Ь" And Chr(i) <> "Ъ" Then
Arr(n) = (Chr(i)) & "1"
n = n + 1
End If
Next
For i = 192 To 223
If Chr(i) <> "З" And Chr(i) <> "Ь" And Chr(i) <> "Ъ" Then
Arr(n) = (Chr(i)) & "2"
n = n + 1
End If
Next
For i = 192 To 223
If Chr(i) <> "З" And Chr(i) <> "Ь" And Chr(i) <> "Ъ" Then
Arr(n) = (Chr(i)) & "3"
n = n + 1
End If
Next
n = 0
For Each sSheet In dDoc.Sheets
For Each oView In sSheet.DrawingViews
If oView.ViewType <> kSectionDrawingViewType Or oView.ViewType <> kDetailDrawingViewType Or oView.ViewType <> kAuxiliaryDrawingViewType Then
If oView.ShowLabel = True Then 'Len(oView.Name) < 3
If sSheet.Name <> oView.ParentView.Parent.Name Then
For i = 0 To dDoc.Sheets.Count
nList = 0
If ArrS(i) <> "" Then
If ArrS(i) = oView.ParentView.Parent.Name Then
nList = i + 1
Exit For
End If
End If
Next
If nList <> 0 Then
Dim oText As String
oText = oView.Label.FormattedText
If Right(oText, 1) = ")" Then
oView.Label.FormattedText = oView.Label.FormattedText & "(" & nList & ")"
Else
oView.Label.FormattedText = oView.Label.FormattedText & " (" & nList & ")"
End If
End If
End If
oView.Name = Arr(n)
n = n + 1
End If
End If
Next
Next
End Sub