Shading alternate lines

R

Ray Greene

I would like to set up a page so that it has alternate lines shaded
grey.
I want the line height to adjust to the size of the font used rather
than using a fixed image as a background, and I would prefer not to
use a table.

Can this be done?

Ray Greene.
 
J

Jezebel

Do-able, but very tricky. I would have thought a table in a textbox would be
the easiest, but if you don't want to do that, then a collection of shaded
rectangles might also work. The hard part of course will be setting the line
heights and positions. You'll need to take into account the font size and
line spacing. If your pages are all exactly consistent (no different-sized
headings, etc) you could attach the line shading to the header or footer.
 
K

Klaus Linke

I would like to set up a page so that it has alternate lines

Hi Ray,

If you have some simple, justified text, you might try to apply shading to
the text with a macro:

Sub AlternateShading()
' works properly only for simple, justified text
ActiveDocument.Content.Characters(1).Select
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Do
Selection.MoveEndWhile Cset:=Chr(13) & Chr(12) & Chr(11),
Count:=wdBackward
Selection.Font.Shading.BackgroundPatternColor = wdColorGray20
Selection.HomeKey Unit:=wdLine, Extend:=wdMove
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdMove
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Loop Until Selection.End = ActiveDocument.Content.End
End Sub


If you want to shade whole lines in cases where the line ends with a
paragraph mark, you could replace the paragraph mark with a tab and a para
mark, and set a right-aligned tab at the right margin, before you run the
macro.

It's messy, and if you ever change anything (text or formatting), you have
to remove and reapply the shading.
The shading will also screw up if you move the doc to another machine with
a different printer driver (since the lines will break differently).

Greetings,
Klaus
 
R

Ray Greene

Thanks for the suggestions Jezebel and Klaus.
Unfortunately neither are quite what I was hoping to achieve. I
suspect that what I want can't be done in Word without using tables.

Ray Greene.
 
Top