LucasC
Automotive
- Feb 18, 2019
- 157
Can someone point out what I've done wrong? The intent is to simply select a textbox and change all lowercase characters to uppercase.
Code:
Private Sub CommandButton41_Click()
On Error Resume Next
If InStr(CATIA.ActiveDocument.Name, ".CATDrawing") < 1 Then
MsgBox "Active file is not a CATDrawing!"
Exit Sub
If Error.Number <> 0 Then
Err.Clear
End If
End If
Dim DrawingDocument1 As Document
Set DrawingDocument1 = CATIA.ActiveDocument
Set Selection2 = DrawingDocument1.selection
Selection2.Text = UCase(Selection2.Text)
DrawingDocument1.selection.Clear
End Sub