06-21-2021
11:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-21-2021
11:35 AM
I don't see where your question1 is getting it's information from but......below I commented out the lines that you don't need just to show what I changed.
If you only want to work with the current sheet (or active sheet) then you don't need to loop through the Sheets collection. Therefore, I commented out the For / Each loop.
Dim oDoc As DrawingDocument: oDoc = ThisDoc.Document
oModel = ThisDoc.ModelDocument
'Dim oSheets As Sheets
Dim oSheet As Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
'oSheets = oDoc.Sheets
oSheet = oDoc.ActiveSheet
If question1=vbNo Then
' For Each oSheet In oSheets
oViews = oSheet.DrawingViews
For Each oView In oViews
'make view label visible
If oView.ViewType = 10501 Then
oView.ShowLabel = True
oView.Label.FormattedText = String1 & String2 & "<Br/>" & String4 &"<Br/>" & String3
End If
Next
' Next
Else
oViews = oSheet.DrawingViews
For Each oView In oViews
If oView.ViewType = 10501 Then
oView.ShowLabel = True
oView.Label.FormattedText = String1 & String2 & "<Br/>" & String4 &"<Br/>" & String3
End If
Next
End If
Thanks,
Randy Mabery
Applications Expert
IMAGINiT Technologies