Janus said:
My body-text document is about 200 pages and everything except
the chapter titles is in two columns. ChapterTitle is a custom style.
Rather than hand-fixing each chapter title to run across both columns,
is there some way that I can just tell ChapterTitle that anything with
that style should be single column (just as I can tell it that
anything with ChapterTitle style should start on a new page)?
This was easy to do with FrameMaker, but I am not looking forward
to a lot of handfixing -- there are a lot of short chapters in the
anthology.
Thank you.
Hi Janus,
In Word, you do need (continuous) section breaks if you want so change the
number of columns.
And there's no built-in way to add those section breaks automatically at
the start/end of some paragraph style.
Usually it's better to avoid layouts that require a lot of manual
formatting to achieve them, if you don't need them *real* bad. It's too
much of a hassle.
You could build a macro to do it, though. If you are used to apply the
heading styles with the built-in keyboard shortcuts, you can name the macro
like the built-in command (ApplyHeading1, ApplyHeading2, ApplyHeading3).
Then the macro is called automatically when you use the shortcut.
Else, you could put a button on some toolbar that calls the built-in
command "ApplyHeading1", or your macro (in case you don't want to replace
the built-in command).
Usually, the command just applies the "Heading 1" style. But your macro
could insert the necessary section breaks, too.
Normal.dot is no good place for such a macro.
Better create a template forthose two-column documents, and put the macro
into its code module.
Set it up with two columns.
The macro below checks if the section breaks are already there, and adds
them if not.
You could possibly improve on the macro quite a bit.
For example, don't add the section breaks if the number of columns is
currently "one" anyway, or if the selection is in a table. You could also
remove the "Space after" from the preceding paragraph and the "space
before" from the next paragraph, and so on.
Greetings,
Klaus
Sub ApplyHeading1()
Dim myRange As Range
Set myRange = Selection.Range
' make sure whole paragraphs are dealt with:
myRange.MoveStartUntil _
Cset:=ChrW(13) & ChrW(12), Count:=wdBackward
If myRange.Characters.Last.Text <> ChrW(13) Then
myRange.MoveEndUntil _
Cset:=ChrW(13) & ChrW(12), Count:=wdForward
myRange.MoveEnd Unit:=wdCharacter, Count:=1
End If
myRange.Select
If myRange.Characters.Last.Next.Text <> ChrW(12) Then
myRange.Select
Selection.Collapse (wdCollapseEnd)
Selection.InsertBreak Type:=wdSectionBreakContinuous
End If
If myRange.Characters.First.Previous.Text <> ChrW(12) Then
myRange.Select
Selection.Collapse (wdCollapseStart)
Selection.InsertBreak _
Type:=wdSectionBreakContinuous
End If
myRange.style = ActiveDocument.Styles(wdStyleHeading1)
myRange.MoveStartWhile _
Cset:=ChrW(12), Count:=wdForward
myRange.Collapse (wdCollapseStart)
With myRange.PageSetup.TextColumns
.SetCount NumColumns:=1
End With
End Sub