hi i was able to achieve it, but i do not know the vba code to reframe to a text
Option Explicit
Private Sub CommandButton1_Click()
ListBox1.AddItem ("2057510200-REF")
End Sub
Private Sub ListBox1_Click()
CATIA.DisplayFileAlerts = False
Dim oDrwDocument As Document
Dim oDrwviews As DrawingViews
Dim drwSelect As Selection
Dim iViews As Long
Set oDrwDocument = CATIA.ActiveDocument
' Retrieve the drawing document's view collection
Set oDrwviews = oDrwDocument.Sheets.Item(1).Views
'For each view search text
Set drwSelect = CATIA.ActiveDocument.Selection
For iViews = 1 To oDrwviews.Count
'Scan all the Texts of the Views
Dim itxt As Integer
For itxt = 1 To oDrwviews.Item(iViews).Texts.Count
Dim getPart As String
getPart = ("*" & oDrwviews.Item(iViews).Texts.Item(itxt).Text & "*")
If InStr(getPart, ListBox1.Text) Then
drwSelect.Add oDrwviews.Item(iViews).Texts.Item(itxt)
CATIA.ActiveWindow.Reframe
Exit Sub
End If
Next
Next
'If CurrentView.Name <> "Background View" Then
'TextFont = odrwview.Item(i).Texts.Item(numtxt).GetFontSize(0, 0)
'If TextFont > 7 Then
'Change the color of the text in RED
'drwselect.Add odrwview.Item(i).Texts.Item(numtxt)
'drwselect.VisProperties.SetRealColor 255, 0, 0, 0
'End If
'End If
'CATIA.ActiveWindow.ActiveViewer.Reframe
'MsgBox "Text highlighted in RED has text height > 7 mm", vbInformation
End Sub