Inserer des champs dans un pied de page
Bonjour
Je voudrais inserer automatiquement des champs dans un pied de page pour obtenir par exemple
Section 2 - Page 2 .
J'y parviens en selectionnant le pied de page par
Code:
1 2 3 4 5 6 7 8 9 10
| ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
'renseigne n° de section
Selection.TypeText Text:="Section "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"SECTION ", PreserveFormatting:=True
'renseigne n° de page
Selection.TypeText Text:=" - Page "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE ", PreserveFormatting:=True |
mais je n'y parviens pas en utilisant :
Code:
1 2 3 4 5 6 7 8 9
| Sub Pagination_Continue()
With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary)
.Range.Text = "Section "
.Range.Fields.Add Range:=ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range, Text:= _
"SECTION ", PreserveFormatting:=True
.Range.Text = " - Page "
.Range.Fields.Add Range:=ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range, Text:= _
"PAGE ", PreserveFormatting:=TrueEnd
End With |
car les differentes entrees "text" et "fields" ecrasent les precedentes
Quelqu'un a t il une solution ? Merci d'avance