Hi,

I have a document that consists of section and page breaks. I'm using
this code to insert a page number footer onto every page. But on the
pages where the content of the document goes to the bottom of the
page, the footer(page number) is not showing up.

Thanks in advance.
_______________________________________________________
Sub insertFooter()
Dim mySCTN As Section

For Each mySCTN In ActiveDocument.Sections
With ActiveDocument.Sections(mySCTN.Index).Footers _
(wdHeaderFooterPrimary)
.PageNumbers.Add _
PageNumberAlignment:=wdAlignPageNumberRight
End With
Next mySCTN


End Sub

insert page footer on every page by DA

DA
Thu Jun 24 17:25:16 CDT 2004

Check your document page setup (ie. margins, and
especially the "Footer from edge" setting) to ensure that
the page number is not being pushed off the page.

The original code I provided you uses a text frame, which
shifts by default when other text infringes on it.

Alternatively, you can use the following, which doesn't
use the frame, although if your footer is not big enough,
this won't help either.

As I said, I'd focus on correct page setup.

Good luck,
Dennis

---------
Sub AddPageNo()
Dim mySCTN As Section

For Each mySCTN In ActiveDocument.Sections
With ActiveDocument.Sections(mySCTN.Index)
.Footers.Item(wdHeaderFooterPrimary).Range.Select
With Selection
.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
End With
Next mySCTN

End Sub



>-----Original Message-----
>Hi,
>
>I have a document that consists of section and page
breaks. I'm using
>this code to insert a page number footer onto every
page. But on the
>pages where the content of the document goes to the
bottom of the
>page, the footer(page number) is not showing up.
>
>Thanks in advance.
>_______________________________________________________
>Sub insertFooter()
>Dim mySCTN As Section
>
>For Each mySCTN In ActiveDocument.Sections
>With ActiveDocument.Sections(mySCTN.Index).Footers _
> (wdHeaderFooterPrimary)
> .PageNumbers.Add _
> PageNumberAlignment:=wdAlignPageNumberRight
>End With
>Next mySCTN
>
>
>End Sub
>.
>

RE: insert page footer on every page by Lemon

Lemon
Fri Jun 25 11:56:01 CDT 2004

Hi DA,

I tried adjusting the footer from edge property, the page number didnt' get displayed.

Allow me to provide you with the background....The pages in this document were inserted from other files(one or two pagers). Hence, some of them might appear to be the 'first page'.

But I noticed when I turned on the header/footer view, on some pages, it displayed "first page footer, section x" and on other "footer, section x".

The page number only appeared on the footer with solely "footer, section x" and not on "first page footer, section x".

what to do?

Thanks,

S

"DA" wrote:

> Check your document page setup (ie. margins, and
> especially the "Footer from edge" setting) to ensure that
> the page number is not being pushed off the page.
>
> The original code I provided you uses a text frame, which
> shifts by default when other text infringes on it.
>
> Alternatively, you can use the following, which doesn't
> use the frame, although if your footer is not big enough,
> this won't help either.
>
> As I said, I'd focus on correct page setup.
>
> Good luck,
> Dennis
>
> ---------
> Sub AddPageNo()
> Dim mySCTN As Section
>
> For Each mySCTN In ActiveDocument.Sections
> With ActiveDocument.Sections(mySCTN.Index)
> .Footers.Item(wdHeaderFooterPrimary).Range.Select
> With Selection
> .Fields.Add Range:=Selection.Range, Type:=wdFieldPage
> .ParagraphFormat.Alignment = wdAlignParagraphCenter
> End With
> End With
> Next mySCTN
>
> End Sub
>
>
>
> >-----Original Message-----
> >Hi,
> >
> >I have a document that consists of section and page
> breaks. I'm using
> >this code to insert a page number footer onto every
> page. But on the
> >pages where the content of the document goes to the
> bottom of the
> >page, the footer(page number) is not showing up.
> >
> >Thanks in advance.
> >_______________________________________________________
> >Sub insertFooter()
> >Dim mySCTN As Section
> >
> >For Each mySCTN In ActiveDocument.Sections
> >With ActiveDocument.Sections(mySCTN.Index).Footers _
> > (wdHeaderFooterPrimary)
> > .PageNumbers.Add _
> > PageNumberAlignment:=wdAlignPageNumberRight
> >End With
> >Next mySCTN
> >
> >
> >End Sub
> >.
> >
>

Re: insert page footer on every page by lemonhalls

lemonhalls
Fri Jun 25 13:20:00 CDT 2004

thanks to all those who helped.
I changed my code to turn off differnt first page footer

Sub insertFooter()

Dim mySCTN As Section
For Each mySCTN In ActiveDocument.Sections
ActiveDocument.Sections(mySCTN.Index). _
PageSetup.DifferentFirstPageHeaderFooter = False
With ActiveDocument.Sections(mySCTN.Index)
.Footers(wdHeaderFooterPrimary).PageNumbers.Add _
PageNumberAlignment:=wdAlignPageNumberRight, _
FirstPage:=True
End With
Next mySCTN

End Sub

now it works =)


___________________________
lemonhalls@hotmail.com (sals) wrote in message news:<13fe859e.0406241132.4bef76d2@posting.google.com>...
> Hi,
>
> I have a document that consists of section and page breaks. I'm using
> this code to insert a page number footer onto every page. But on the
> pages where the content of the document goes to the bottom of the
> page, the footer(page number) is not showing up.
>
> Thanks in advance.
> _______________________________________________________
> Sub insertFooter()
> Dim mySCTN As Section
>
> For Each mySCTN In ActiveDocument.Sections
> With ActiveDocument.Sections(mySCTN.Index).Footers _
> (wdHeaderFooterPrimary)
> .PageNumbers.Add _
> PageNumberAlignment:=wdAlignPageNumberRight
> End With
> Next mySCTN
>
>
> End Sub

RE: insert page footer on every page by Lemon

Lemon
Fri Jun 25 13:24:02 CDT 2004

thanks for your help DA
I changed my code to turn off differnt first page footer

Sub insertFooter()

Dim mySCTN As Section
For Each mySCTN In ActiveDocument.Sections
ActiveDocument.Sections(mySCTN.Index). _
PageSetup.DifferentFirstPageHeaderFooter = False
With ActiveDocument.Sections(mySCTN.Index)
.Footers(wdHeaderFooterPrimary).PageNumbers.Add _
PageNumberAlignment:=wdAlignPageNumberRight, _
FirstPage:=True
End With
Next mySCTN

End Sub

now it works =)

___________________________

"Lemon" wrote:

> Hi DA,
>
> I tried adjusting the footer from edge property, the page number didnt' get displayed.
>
> Allow me to provide you with the background....The pages in this document were inserted from other files(one or two pagers). Hence, some of them might appear to be the 'first page'.
>
> But I noticed when I turned on the header/footer view, on some pages, it displayed "first page footer, section x" and on other "footer, section x".
>
> The page number only appeared on the footer with solely "footer, section x" and not on "first page footer, section x".
>
> what to do?
>
> Thanks,
>
> S
>
> "DA" wrote:
>
> > Check your document page setup (ie. margins, and
> > especially the "Footer from edge" setting) to ensure that
> > the page number is not being pushed off the page.
> >
> > The original code I provided you uses a text frame, which
> > shifts by default when other text infringes on it.
> >
> > Alternatively, you can use the following, which doesn't
> > use the frame, although if your footer is not big enough,
> > this won't help either.
> >
> > As I said, I'd focus on correct page setup.
> >
> > Good luck,
> > Dennis
> >
> > ---------
> > Sub AddPageNo()
> > Dim mySCTN As Section
> >
> > For Each mySCTN In ActiveDocument.Sections
> > With ActiveDocument.Sections(mySCTN.Index)
> > .Footers.Item(wdHeaderFooterPrimary).Range.Select
> > With Selection
> > .Fields.Add Range:=Selection.Range, Type:=wdFieldPage
> > .ParagraphFormat.Alignment = wdAlignParagraphCenter
> > End With
> > End With
> > Next mySCTN
> >
> > End Sub
> >
> >
> >
> > >-----Original Message-----
> > >Hi,
> > >
> > >I have a document that consists of section and page
> > breaks. I'm using
> > >this code to insert a page number footer onto every
> > page. But on the
> > >pages where the content of the document goes to the
> > bottom of the
> > >page, the footer(page number) is not showing up.
> > >
> > >Thanks in advance.
> > >_______________________________________________________
> > >Sub insertFooter()
> > >Dim mySCTN As Section
> > >
> > >For Each mySCTN In ActiveDocument.Sections
> > >With ActiveDocument.Sections(mySCTN.Index).Footers _
> > > (wdHeaderFooterPrimary)
> > > .PageNumbers.Add _
> > > PageNumberAlignment:=wdAlignPageNumberRight
> > >End With
> > >Next mySCTN
> > >
> > >
> > >End Sub
> > >.
> > >
> >