supress printing of blank rows?

J

Joseph LeMay

using Word 2003, we have a table where some of the rows will sometimes
be blank. is there a way to keep these blank rows from printing?
(trying to conserve space and paper)
 
J

Jay Freedman

Hi, Joseph,

If you select the whole blank row and format it with the Hidden font
attribute, it won't print. If you then go to Tools > Options > View
and check the Hidden box, you can see the row on screen but it still
won't print.

If the table is big and has a lot of empty rows, you may want to use a
macro to do the formatting:

Public Sub HideBlankRows()
Dim oTbl As Table
Dim oRow As Row
Dim oCell As Cell
Dim IsBlank As Boolean

For Each oTbl In ActiveDocument.Tables
For Each oRow In oTbl.Rows
IsBlank = True
For Each oCell In oRow.Cells
' end-of-cell mark is 2 chars
If Len(oCell.Range.Text) > 2 Then
IsBlank = False
Exit For
End If
Next oCell

If IsBlank Then oRow.Range.Font.Hidden = True
Next oRow
Next oTbl
End Sub

See http://www.gmayor.dsl.pipex.com/installing_macro.htm for
instructions on putting the macro into a template.

Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word
 

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