Continuous section break interfering with odd/even page header

A

aehan

I have created a tempate that has a different first page header/footer and
odd/even headers/footers for the rest of the document. I want to start the
second page of the document as two even columns (the first page is not in
columns). Users are not regular Word users, therefore I have a macro that
does that for them (see below). However, when you run the macro the odd/even
page header that has been set up changes and instead the header for the first
page is inserted. The code finds the first character on the current page,
inserts a continuous section break and sets up 2 even spaced columns. Does
anyone know why it plays havoc withthe header? I'd be really interested to
know and grateful for a solution.

The code is:

Sub ConvertToColumns()

'converts the contents of the current page to two equal columns

' moves to te left of the first character at the top of the current page

Selection.Bookmarks("\Page").Select
Selection.Collapse wdCollapseStart

'creates a continuous section break and two even columns

With Selection.PageSetup.TextColumns
.SetCount NumColumns:=2
.EvenlySpaced = True
.LineBetween = False
.Width = CentimetersToPoints(6.69)
.Spacing = CentimetersToPoints(1.27)
End With

'moves to the right of the last character on the page window (not to footer)
Selection.Bookmarks("\Page").Select
Selection.Collapse wdCollapseEnd

End Sub

Thanks for any help

Aehan
 
J

Jean-Guy Marcil

aehan was telling us:
aehan nous racontait que :
I have created a tempate that has a different first page
header/footer and odd/even headers/footers for the rest of the
document. I want to start the second page of the document as two
even columns (the first page is not in columns). Users are not
regular Word users, therefore I have a macro that does that for them
(see below). However, when you run the macro the odd/even page
header that has been set up changes and instead the header for the
first page is inserted. The code finds the first character on the
current page, inserts a continuous section break and sets up 2 even
spaced columns. Does anyone know why it plays havoc withthe header?
I'd be really interested to know and grateful for a solution.

Generally speaking, when Word inserts a section breaks, the header/footer
are set to "Same as Previous". If you insert a two-column sections, a
section break is inserted. Since you have defined a First page header in
section 1, the second page (now section 2) becomes the first page of the
two-column section, hence the repeating header. You have to specify in your
code that the new section does not have a first-page header/footer.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
A

aehan

Thankyou, I played around with it - recording the macro as I went - and
managed to sort the problem. I really do appreciate you replying, you have
been very helpful.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top