Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
J_Dumont
588 Views, 5 Replies

Update View Labels on current sheet

Hello,

 

I could some assistance with the following code. The program updates all of the views on all sheets properly.

However, I would like the option to process the current sheet only.

 

Here is my current code.

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
	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
Labels (5)