Voilà, j'ai un problême avec mon code :
Private Sub test_Change() ' c'est quand on modifie une rtf Dim reg As New RegExp Dim matches As MatchCollection Dim amatch As match Dim asubmatches As submatches Dim asubmatch As match Dim pos As Integer
pos = test.SelStart test.SelLength = Len(test.Text) test.SelStart = 0 test.SelColor = QBColor(0) reg.MultiLine = True reg.Pattern = mask reg.IgnoreCase = True reg.Global = True Set matches = reg.Execute(test.Text) For Each amatch In matches ' ça, ça fonctionne 'MsgBox "trouvé:" + Match.Value + " a la position " + Str(Match.FirstIndex) test.SelStart = amatch.FirstIndex test.SelLength = amatch.Length test.SelColor = QBColor(Text1) Set asubmatches = amatch.submatches For Each asubmatch In asubmatches ' mais cette boucle ne fonctionne pas : "Un objet est requis" si je mets "(test)" comme masque pour l'ER MsgBox asubmatche Next Next test.SelLength = 0 test.SelStart = pos test.SelColor = QBColor(0) End Sub
|
Que dois-je faire ?
Merci d'avance
Baune ChristianMessage privésite perso :
[ Lien ]