Re: non-printing table cell shading

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Lee (me_at_privacy.net)
Date: 09/07/04


Date: Tue, 7 Sep 2004 11:00:30 +0100


"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:gtupj01210isd7act6va6k9fv0mqhurnp2@4ax.com...
> G'day "Lee" <me@privacy.net>,
>
> Yes, you can iterate each Table in the ActiveDocumet.Tables
> collection, then iterate each cell in that Table's range, and turn off
> shading. You would do this on a throw-away copy of your document,
> publish/distribute it and revert to your development source with
> shading intact.
>
>

Hello Mr Heretic

Thanks for the reply.

I was not too sure what you meant by a "throw-away" copy of the doc but I
did find a way to do it.

In case this helps someone else one day:

a) Create a sub routine that replaces the File -> Print... menu option:
        Public Sub FilePrint()
b) Convert the relevant cell backgrounds (in my case these are in two
tables) to white (column 2 below the table heading in each case):

    Dim i As Integer, n As Long
            i = ActiveDocument.Tables(3).Rows.Count
        For n = 2 To i
    With ActiveDocument.Tables(3).Cell(n, 2)
     .Shading.BackgroundPatternColor = wdColorWhite
    End With
        Next n
    With ActiveDocument.Tables(4).Cell(2, 2)
     .Shading.BackgroundPatternColor = wdColorWhite
    End With

c) Print the document:
    ActiveDocument.PrintOut

d) Replace the colour backgrounds:

    For n = 2 To i
    With ActiveDocument.Tables(3).Cell(n, 2)
     .Shading.BackgroundPatternColor = wdColorLightGreen
    End With
    Next n
    With ActiveDocument.Tables(4).Cell(2, 2)
     .Shading.BackgroundPatternColor = wdColorLightGreen
    End With

e) Close the sub-routine:

    End Sub

f) Point the default print button to the same subroutine:

    Public Sub FilePrintDefault()
        Call FilePrint
    End Sub

I am a real beginner to all this so any comments or improvements very
welcome.

Lee



Relevant Pages

  • Re: non-printing table cell shading
    ... you can iterate each Table in the ActiveDocumet.Tables ... shading intact. ... Lee reckoned: ... >used coloured cell shading to guide users where they should enter data. ...
    (microsoft.public.word.vba.userforms)
  • Re: Word 2007 table cell color selection
    ... Your comment on the display driver got me thinking. ... The problem was not there on the Laptop. ... What you describe as blue shading sounds correct, ... If I hit enter or click in the table cell ...
    (microsoft.public.word.tables)
  • Re: Using iterators to write in the structure being iterated through?
    ... to iterate through will always contain some floats. ... which has the additional mirror symmetry in the middle of the cell. ... C is an instance of this class representing data on a 50-long array. ...
    (comp.lang.python)
  • Re: For me, using Word 2007, the shading tab does not show the current color.
    ... The "Shading" tool does not display the current shading of the cell. ... go to the reveal formatting pane ... (styles pane> style inspector (does anyone see a use for this feature?) ...
    (microsoft.public.word.tables)
  • Re: How to copy table cell shading to another cell in Word?
    ... The following will set the shading of the first table in a document to the ... Doug Robbins - Word MVP ... repeat this color in another cell. ... The "Shading" tool does not display the current shading of the cell. ...
    (microsoft.public.word.tables)