Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Continuous section break interfering with odd/even page header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aehan - 18 Sep 2005 14:12 GMT
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
Jean-Guy Marcil - 19 Sep 2005 16:35 GMT
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
[quoted text clipped - 7 lines]
> 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.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

aehan - 19 Sep 2005 21:06 GMT
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

> aehan was telling us:
> aehan nous racontait que :
[quoted text clipped - 17 lines]
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.