Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The situation: Drawing --> Sheet --> View --> Sketch --> TextBoxes
These TextBoxes need changing, on several drawings. Not that complicated, it seems.
But the line that does the actual work (oTextbox.Text = "TEST") refuses to work. The TextBox.Text property is read/write, so what's the problem?
Private Sub ChangeTextboxText()
'drawing
Dim idwDoc As DrawingDocument
Set idwDoc = ThisApplication.ActiveDocument
'active sheet
Dim oSheet As sheet
Set oSheet = idwDoc.ActiveSheet
'loop views
Dim oView As DrawingView
For Each oView In oSheet.DrawingViews
'loop sketches
Dim oSketch As sketch
For Each oSketch In oView.Sketches
'loop textboxes
Dim oTextbox As TextBox
For Each oTextbox In oSketch.TextBoxes
'change text
oTextbox.Text = "TEST"
Next oTextbox
Next oSketch
Next oView
End Sub
Solved! Go to Solution.