Ouvrez dans Microsoft Word une copie du texte à traiter Ouvrez VBA (Visual Basic pour Applications) avec les touches [Alt] [F11] Effectuez les commandes : Insertion\Module Dans le nouveau module qui s'ouvre collez l'intégralité du texte ci-après, [Sub] et [End Sub] compris Revenez dans Word, la macrocommande "Convertit_Notes_De_Fin_En_Texte_Brut" se trouve maintenant dans Développeur\Macros. IL suffit de double-cliquer dessus pour l'exécuter Sub Convertit_Notes_De_Fin_En_Texte_Brut () 'Macro écrite par Georges Mion (13 Aout 2023) Dim i As Integer Dim Nbre_Ref As Integer Dim Nbre_Renvois As Integer Dim Numero_Note As String Dim Var_field As Field Dim MaSelection As Selection If MsgBox("Avez vous pensé à sauvegarder votre fichier ?", vbYesNo Or 48 Or 256, " A T T E N T I O N") = vbNo Then Exit Sub End If If ActiveDocument.Endnotes.Count = 0 Then MsgBox ("Il n'y a pas de Notes de fin dans le texte"), 16, "GeorgesMion.Com" Exit Sub End If Nbre_Ref = ActiveDocument.Endnotes.Count For i = 1 To Nbre_Ref ActiveDocument.Endnotes(i).Reference.Font.ColorIndex = wdRed Next MsgBox "LA PROCEDURE PEUT PRENDRE DU TEMPS...", 0 + 64, " P A T I E N T E Z quelques instants" i = 1 Do While i < Nbre_Ref + 1 Selection.EndKey unit:=wdStory Selection.Paragraphs.Add Selection.EndKey unit:=wdStory Numero_Note = i Selection.Text = Numero_Note Selection.EndKey unit:=wdStory Selection.TypeText Text:=". " Selection.EndKey unit:=wdStory If ActiveDocument.Endnotes(i).Range <> "" Then ActiveDocument.Endnotes(i).Range.Copy Else: With ActiveDocument.Endnotes(i).Range .Text = " R E F E R E N C E V I D E" .Bold = True .Italic = True .Underline = wdUnderlineSingle .Copy End With End If Selection.Paste With ActiveDocument.Paragraphs.Last.Range.Font .ColorIndex = wdBlue ' C'est là qu'on peut changer la couleur End With With ActiveDocument.Paragraphs.Last.Format .Alignment = wdAlignParagraphJustifyMed .LeftIndent = InchesToPoints(1) .CharacterUnitFirstLineIndent = -2 End With i = i + 1 Loop With ActiveDocument.Content.Find .Text = " R E F E R E N C E V I D E" .Replacement.Font.Bold = True .Replacement.Font.ColorIndex = 5 .Execute Replace:=wdReplaceAll End With If ActiveDocument.Range.Fields.Count <> 0 Then MsgBox ("Il y a " & ActiveDocument.Fields.Count & " Renvois"), 0, "GeorgesMion.Com" End If Nbre_Renvois = ActiveDocument.Fields.Count ActiveDocument.Fields.Update If ActiveDocument.Fields.Update = 0 And ActiveDocument.Range.Fields.Count <> 0 Then MsgBox "Mise à jour des renvois réussi", 0, "GeorgesMion.Com" End If For i = 1 To ActiveDocument.Fields.Count ActiveDocument.Fields.Unlink Next i If ActiveDocument.Endnotes.Count <> "0" Then Dim Réponse_Exposant As String Select Case MsgBox("Vos notes sont-elles au format EXPOSANT ?", vbYesNo, "GeorgesMion.Com") Case vbYes Réponse_Exposant = 1 Case vbNo Réponse_Exposant = 2 End Select Do Until Numero_Note = "1" Selection.GoTo What:=wdGoToEndnote, Which:=wdGoToAbsolute, Count:=ActiveDocument.Endnotes.Count Numero_Note = ActiveDocument.Endnotes(ActiveDocument.Endnotes.Count).Index Selection.InsertAfter Numero_Note With Selection.Range.Font Select Case Réponse_Exposant Case 1 .Superscript = True Case 2 .Superscript = False End Select .ColorIndex = wdBlue End With Selection.GoTo What:=wdGoToEndnote, Which:=wdGoToAbsolute, Count:=ActiveDocument.Endnotes.Count Selection.Delete Loop End If MsgBox (Nbre_Ref & " Note(s) de Fin " & "et " & Nbre_Renvois & " Renvoi(s) ont été traités"), 0, "GeorgesMion.Com" With ActiveDocument.Content.Find .Text = "Erreur ! Signet non défini." .Replacement.Font.Bold = True .Replacement.Font.ColorIndex = 5 .Execute Replace:=wdReplaceAll End With i = 0 Selection.HomeKey unit:=wdStory With Selection.Find .Text = "Erreur ! Signet non défini." .Execute End With While Selection.Find.Found i = i + 1 Selection.Find.Execute Wend If i <> 0 Then MsgBox " A t t e n t i o n, Il reste à supprimer " & i & " occurence(s) de L'Erreur [ Signet non défini ]", 16, "GeorgesMion.Com" Else MsgBox ("Il n'y a pas d'erreur de renvois"), 0, "GeorgesMion.Com" End If End Sub