Still the same result.
The problem is that I format the footers (on section 7 and beyond) so
that even page #'s are on the left and odds on the right, by actually
going in to the footers and saying 'paragraphalignleft' and vice versa.
I set up the first page with a user-defined 'FirstPageStyle' (always
odd page) and then the next page with 'EvenPageStyle' and then the next
page with 'OddPageStyle' and then backspace out of those to get back to
the first page. If the OddAndEven setting is not true then when I go
off the first page and into the second page (even) the formatting is
gone and the page # is on the same side (right) as the page above.
If I do set the OddAndEven setting, those styles that I set up persist
but like i said, the 4 blank pages are added to sections 1, 2, 5 & 6.
After I run this macro, if I run another one that sets the setting to
False, the blank pages disappear and the formatting of the preceding
page #'s disappear.
If you say that OddAndEvenPagesHeaderFooter affects the whole document,
then really is there any solution? Do I need to set those earlier
sections to a different setting for OddAndEven, because sections 3 and
4 don't get extra pages so something is different, which I'll try to
find.
ccrites@carroll.edu was telling us:
ccrites@carroll.edu nous racontait que :
> Still the same result.
I am not sure what to say at this point because the code I posted does not
create the problem you seem to have on my machine. So, I think this means
that there is something wrong with your document set up.
> The problem is that I format the footers (on section 7 and beyond) so
> that even page #'s are on the left and odds on the right, by actually
> going in to the footers and saying 'paragraphalignleft' and vice
Do not go into the footer. Use the Range object.
> versa. I set up the first page with a user-defined 'FirstPageStyle'
> (always odd page) and then the next page with 'EvenPageStyle' and
You mean you have a "Next page odd" section break, but no "different
odd/even" section setting?
You know you are going to add a section that requires different odd and even
headers/footers. So, make sure that you set this up for the existing
sections before running the macro. This way, the added section will
automatically have this setting as it is document wide (no need to code for
that, as in my previous post example).
> then the next page with 'OddPageStyle' and then backspace out of
I would recommend not using the Selection object to add and then remove
stuff.
> those to get back to the first page. If the OddAndEven setting is
> not true then when I go off the first page and into the second page
> (even) the formatting is gone and the page # is on the same side
> (right) as the page above.
Yes, because you do not seem to have different even/odd for your existing
sections.
> If I do set the OddAndEven setting, those styles that I set up persist
> but like i said, the 4 blank pages are added to sections 1, 2, 5 & 6.
[quoted text clipped - 5 lines]
> If you say that OddAndEvenPagesHeaderFooter affects the whole
> document, then really is there any solution? Do I need to set those
Yes, I have done tbhis many times.
> earlier sections to a different setting for OddAndEven, because
> sections 3 and 4 don't get extra pages so something is different,
> which I'll try to find.
Set up the whole document with different odd/even headers/footers, you can
keep "Same as previous" in this case for all footers. Just set up the first
section. You can add a temporary even page to set up the footers. Then
delete it. Word will remember those settings and later sections that have an
even footer will pick it up from the first section, even if this first
section does not actually have an even page.
Then your code can be as simple as the one I posted previously.
If you try all this and still run into the same problem, send me your
document after you have tried using my code (or something along the same
lines) and I will have a look.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
ccrites@carroll.edu - 19 May 2006 14:59 GMT
Thanks for your reply. I will give it a shot.