I am inserting page breaks as follows:
MyApp.Selection.InsertBreak Type:=wdPageBreak

I want to set up the footer. When I record using the VBA recorder I get this:
Selection.Selections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberCenter, FirstPage:=False

How do I modify this using the the MyApp variable name from the first
example? That is MyApp.Selection.Selections(1) does not work.

Thanks
EM

Re: Inserting Footer in Word Doc by ivo

ivo
Fri Jun 13 15:17:24 PDT 2008

Are you sure that part of your code is Selections(1) and not Sections(1)?


"ExcelMonkey" <ExcelMonkey@discussions.microsoft.com> wrote in message
news:2FB7F4B5-07A7-4474-BA1F-797B09542D8D@microsoft.com...
>I am inserting page breaks as follows:
> MyApp.Selection.InsertBreak Type:=wdPageBreak
>
> I want to set up the footer. When I record using the VBA recorder I get
> this:
> Selection.Selections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
> wdAlignPageNumberCenter, FirstPage:=False
>
> How do I modify this using the the MyApp variable name from the first
> example? That is MyApp.Selection.Selections(1) does not work.
>
> Thanks
> EM



Re: Inserting Footer in Word Doc by ExcelMonkey

ExcelMonkey
Mon Jun 16 11:42:01 PDT 2008

Yup that was the issue. Somehow missed that.

Thanks

EM

"ivo" wrote:

> Are you sure that part of your code is Selections(1) and not Sections(1)?
>
>
> "ExcelMonkey" <ExcelMonkey@discussions.microsoft.com> wrote in message
> news:2FB7F4B5-07A7-4474-BA1F-797B09542D8D@microsoft.com...
> >I am inserting page breaks as follows:
> > MyApp.Selection.InsertBreak Type:=wdPageBreak
> >
> > I want to set up the footer. When I record using the VBA recorder I get
> > this:
> > Selection.Selections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
> > wdAlignPageNumberCenter, FirstPage:=False
> >
> > How do I modify this using the the MyApp variable name from the first
> > example? That is MyApp.Selection.Selections(1) does not work.
> >
> > Thanks
> > EM
>
>
>