Salut
Petite modification dans la fonction recherchemot au niveau des Patterns
la variable ChemDico est déclarée en globale (au tout début du code) Dim ChemDico As String et initialisée dans la sub Load ChemDico = "C:\PersoFrancis\Etude RegExp\" elle désigne l'endroit du dossier ou ce trouve les fichiers Dico.txt.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 If OptionRech(0).Value = True Then 'début ou mot complet LePattern = "(" & StrMot & "[\w-zâäàéèùêëîïôöçñ]*)" Dim Caract As String Caract = Left(LCase(StrMot), 1) 'Si un mot commence par un caractère accentué, 'il faut rechercher dans le dictionnaire complet If Asc(Caract) < 123 Then NomDico = ChemDico & Caract & ".txt" Else NomDico = ChemDico & "Dico.txt" End If End If If OptionRech(1).Value = True Then 'partie du mot LePattern = "([\-\w-zâäàéèùêëîïôöçñ]*" & StrMot & "[\w-zâäàéèùêëîïôöçñ]*)" NomDico = ChemDico & "Dico.txt" End If If OptionRech(2).Value = True Then 'fin du mot LePattern = "([\-\w-zâäàéèùêëîïôöçñ]*" & StrMot & "\b)" NomDico = ChemDico & "Dico.txt" End If
Si ces fichiers sont dans le même dossier que l’exécutable (ou projet), la commande peut être ChemDico = App.Path & "\".
Si tu es toujours intéressè par les synonymes, antonymes (nécessite d'avoir Word sur ton système) et anagrammes, j'ai ce qu'il te faut.
Partager