Rappel : les numéros des citations et des sources doivent etre entre crochets : [n] (utilisez les préférences IEEE)
si vous ne voulez pas la couleur bleue vous pouvez l'enlever à la ligne 38 du code
La bibliographie doit être à la fin (du moins il ne doit pas ya voir d'autres numéros de la forme [n] après)
N'oubliez pas de changer le nombre de sources !
Gentle reminder : use the preferences IEEE or every citations and their sources in the bibliography has their number to be under [n]
If you don't want the blue color ou can erase it at the line 38 of the following code.
Your bibliography has to be at the end (in fact it has to be no other numbers like that : "[n]" after)
Don't forget to change the number of sources ! "NombreDeSources = ..."
Copier le code a partir de "Sub Links()"
Copy from "Sub Links()" to the end
()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
Sub Links()
'
' Links Macro
' Déclaration des variables
Dim n As Integer
Dim i As Integer
Dim x As Integer
Dim NombreDeSources As Integer
'Programme à utiliser avec Zotero avec les préférences de document : IEEE
'///////////////////////////////////CHANGER ICI//////////////////////////////////////////////////////
NombreDeSources = 1 'nombre de sources
'////////////////////////////////////////////////////////////////////////////////////////////////////
For n = 1 To NombreDeSources
'Sélection de la page
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=1
Selection.Find.ClearFormatting
'Recherche et sélection des sources
With Selection.Find
.Text = "[" & n & "]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
For x = 1 To 10
Selection.Find.Execute
Selection.Font.ColorIndex = wdBlue 'changement de couleur des numéros en bleu (facultatif)
Next x
'Création des signets
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Source" & n
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
'Creation des liens (une même source peut-etre utilisée jusqu'à 10 fois pour que le programme
'le capte tjs sinon changez le nombre après "For i = 1 To ...")
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=1
Selection.Find.ClearFormatting
For i = 1 To 10
If Selection.Find.Execute And Not (Selection.Bookmarks.Exists("Source" & n)) Then
Selection.InsertCrossReference ReferenceType:="Signet", ReferenceKind:= _
wdContentText, ReferenceItem:="Source" & n, InsertAsHyperlink:=True, _
IncludePosition:=False, SeparateNumbers:=False, SeparatorString:=" "
End If
Next i
Next n
End Sub
18 июн 2022