1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| ' curseur home
'Selection.HomeKey Unit:=wdStory
' curseur au début du 2e paragraphe
Selection.MoveDown Unit:=wdParagraph, Count:=1
' sélectionne le 2e paragraphe
Selection.Paragraphs(1).Range.Select
' copie le paragraphe sélectionné
Selection.Copy
' remplace le paragraphe sélectionné par @
Selection.TypeText Text:="@"
' curseur au début du 1er paragraphe
Selection.MoveUp Unit:=wdParagraph, Count:=2
' sélectionne le 1er paragraphe
Selection.Paragraphs(1).Range.Select
' insère un lien vers une note de fin de document
With Selection
With .EndnoteOptions
.Location = wdEndOfDocument
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End With
.Endnotes.Add Range:=Selection.Range, Reference:=""
End With
' colle le 2e paragraphe comme note de fin de document
Selection.Paste
' curseur home
Selection.HomeKey Unit:=wdStory
' recherche et sélectionne @
Selection.Find.ClearFormatting
With Selection.Find
.Text = "@"
.Forward = True
End With
Selection.Find.Execute
' sélectionne le paragraphe arobase et le coupe
Selection.Paragraphs(1).Range.Select
Selection.Cut
' le curseur est ainsi placé au début du 3e paragraphe,
' et la 2e boucle peut commencer... |
Partager