I made this short method to setup a header/footer in a word document:
Code:
Public Sub headerFooter(f As Form, bD As Word.Document)
With bD.Sections(1)
.Headers(wdHeaderFooterPrimary).Range.Text = "Alle registrerede data vedr. PersonId: " & f.PersonID & " " & HentFMENavn(f.PersonID)
.Footers(wdHeaderFooterPrimary).Range.Text = "Sammensat " & StrConv(Format(Date, "dddd"), vbProperCase) & " den " & Date & vbTab & vbTab & "Side "
.Footers(wdHeaderFooterPrimary).Range.Fields.add Selection.Range, wdFieldEmpty, "PAGE ", True
.Footers(wdHeaderFooterPrimary).Range.Text = " af "
.Footers(wdHeaderFooterPrimary).Range.Fields.add Selection.Range, wdFieldEmpty, "NUMPAGES ", True
End With
End Sub
BUT the actual digits for the fields PAGE and NUMPAGES is NOT writen in the footer - they are writen in the normal text area !
What do I need to change in the code ?


EDIT: Now I see I should have posted in WORD VBA - sorry !