Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ola amigos tenho que localizar e Substituir uma palavra que esta dentro de um texto
Estou usando este código mas ele não substitui.
Private Sub Command1_Click()
st1 = "edu" 'fragmento a procurar
If Text1.Tag = "" Then
cm = 1
Else
cm = CDbl(Text1.Tag)
End If
If cm >= Len(Text1.Text) Then cm = 1
For a = cm To Len(EditorHex.RichTextBox2.Text)
If Mid(EditorHex.RichTextBox2.Text, a, Len(st1)) = st1 Then
EditorHex.RichTextBox2.SelStart = a - 1
EditorHex.RichTextBox2.SelLength = Len(st1)
If Text1.Text = EditorHex.RichTextBox2.SelText Then
EditorHex.RichTextBox2.SetFocus
End If
EditorHex.RichTextBox2.Tag = (a - 1) + Len(st1) 'conserva
Exit For
End If
Next
End Sub
alguem pode me ajudar?
obrigado.
Carregando comentários...