Dim Ligne as String, i as long, j as long,Idx as long
Open "Monfichier.txt" for input as #1
idx = 1
While not eof(1)
Line Input #1,Ligne
i = instr(Ligne,"{\k")
While i <> 0
j = instr(Ligne,"}")
Ligne = left$(Ligne,i-1) & "(time " & mid$(ligne,i+3,j-i-3) & ")" & mid$(ligne,j+1)
i = instr(Ligne,"{\k")
Msgbox "La ligne N°" & idx & " a été changé en " & vbcrlf & ligne,vbOkOnly
Wend
idx = idx +1
Wend
Close #1
Cela devrait fonctionner ! J'ai supposer que tu pouvais avoir plusieurs "{\k...}" sur la meme ligne. Si ce n'est pas le cas, alors voila le code :
Dim Ligne as String, i as long, j as long,Idx as long
Open "Monfichier.txt" for input as #1
idx = 1
While not eof(1)
Line Input #1,Ligne
i = instr(Ligne,"{\k")
if i <> 0
j = instr(Ligne,"}")
Ligne = left$(Ligne,i-1) & "(time " & mid$(ligne,i+3,j-i-3) & ")" & mid$(ligne,j+1)
Msgbox "La ligne N°" & idx & " a été changé en " & vbcrlf & ligne,vbOkOnly
End if
idx = idx +1
Wend
Close #1
Christophe R.