Since every page is its own section, loop through the document's Sections
collection. Something like this:
Sub demo()
Dim oSec As Section
Dim SecNum As Long
Dim SecCount As Long
SecCount = ActiveDocument.Sections.Count
For SecNum = 1 To SecCount
Set oSec = ActiveDocument.Sections(SecNum)
oSec.Footers(wdHeaderFooterPrimary).Range.Text _
= "Page " & SecNum & " of " & SecCount
Next
End Sub

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> I am building complex documents that need Page X of Y in the footer,
> and this is happening all in VBA. I am combining documents in code,
[quoted text clipped - 7 lines]
> fill in the bookmark with Page X of Y. Please help!
> Derek
Derek Hart - 26 Jun 2007 21:55 GMT
I might have more sections than just one per page... lots of columns... how
can I do this per page?
Derek
> Since every page is its own section, loop through the document's Sections
> collection. Something like this:
[quoted text clipped - 24 lines]
>> fill in the bookmark with Page X of Y. Please help!
>> Derek
Jay Freedman - 27 Jun 2007 01:53 GMT
Why can't your macro just stick an ordinary Page {PAGE} of {NUMPAGES}
in the footer of the combined document? There's no reason the fields
should need to link back to the source documents.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>I might have more sections than just one per page... lots of columns... how
>can I do this per page?
[quoted text clipped - 29 lines]
>>> fill in the bookmark with Page X of Y. Please help!
>>> Derek