Bonjour, je suis en word 2010 et je n'arrive pas à updater mes headers dans mon document. Pourtant, j'utilise la même logique que pour updater le footer, que j'arrive pourtant à updater...
Voilà donc mon code:Je commence à pogner les nerfs et je crois bien avoir essayer tous les codes d'exemple que je trouve sur internet. Merci bien de prendre une petite minute pour un gars qui trouve votre forum bien pratique!
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
21
22 'Updater les fields et fermer la fenêtre ActiveDocument.Fields.Update 'Permet de mettre à jour les pieds de page des trois sections, et de celui de la première page de la section 3 ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(2).Footers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(2).Headers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(3).Footers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(3).Headers(wdHeaderFooterPrimary).Range.Fields.Update ActiveDocument.Sections(3).Footers(wdHeaderFooterFirstPage).Range.Fields.Update ActiveDocument.Sections(3).Headers(wdHeaderFooterFirstPage).Range.Fields.Update 'Mise à jour de la text box sur la page de présentation Dim oRange As Word.Range Dim oShape As Word.Shape Set oRange = ActiveDocument.Sections(1).Range If oRange.ShapeRange.Count > 0 Then For Each oShape In oRange.ShapeRange oShape.TextFrame.TextRange.Fields.Update Next End If Set oRange = Nothing UserForm1.Hide
Partager