Results 1 to 4 of 4

Thread: Change Shading

  1. #1
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts
    This question is about Word 2000 running under XP Pro SP-3.

    I have a long document that contains many Word tables containing text quotes. All of these are formatted with the Shading Fill set to Ivory. I would like to set it to No Fill or perhaps to the faintest of grays before I print it. Some of the text font is set to red and/or blue. I would like to retain that attribute or I would just set my Desk Jet to print in black and white only.

    Is there an easy way to change the shading in all these tables?

    I tried selecting the whole document and accessing Format>Borders And Shading>Shading and selecting "No Fill." That does not work.

    I also have a copy of Open Office 3, Build 9379, and wonder if it might be easier to do in OO Writer?

    Thanks,

    baumgrenze
    Baumgrenze
    Hier sind wir tief eingewurzelt.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could run this macro:

    Code:
    Sub RemoveTableShading()
      Dim tbl As Table
      For Each tbl In ActiveDocument.Tables
    	With tbl.Shading
    	  .Texture = wdTextureNone
    	  .ForegroundPatternColor = wdColorAutomatic
    	  .BackgroundPatternColor = wdColorAutomatic
    	End With
      Next tbl
    End Sub

  3. #3
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thank you Hans!

    I tried quickly right after your very prompt reply and realized I needed to learn how to get the macro into Word so I could run it. This evening I tried it on a subsample of the project, and then, with some fear and trembling, edited it a bit. It now reads

    Sub ShadingTable()
    Dim tbl As Table
    For Each tbl In ActiveDocument.Tables
    With tbl.Shading
    .Texture = wdTextureNone
    .ForegroundPatternColor = wdColorGray05
    End With
    Next tbl
    End Sub

    This gave me a not very ink hungry way to shade the tables subtly without wiping out the yellow portion of the 3-in-1 cartridge that HP put in my DeskJet 882C. I noticed, after the fact, that some of the original text was in red and blue and I wanted to preserve that, so I just deleted the BackgroundPaternColor line in your macro. I confess the distinction between "background" and "foreground" is counterintuitive to me, but it worked. Now I see I must find a good manual and learn about managing the macros, where they live and how to move them about. Years ago I was pretty comfortable with writing macros using Woody's "Underground Guide" but I never made the transition to today's product. There are so many other things to do.

    Thanks again for your help,
    Baumgrenze
    Hier sind wir tief eingewurzelt.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you want the macro to be available in all your documents, you can store it in the default template Normal.dot. You can copy the code in the Visual Basic Editor, or you can do it from within Word, using Tools | Templates and Add-ins... > Organizer. (Note: the Organizer doesn't let you copy individual macros, but entire modules)

    You'll find several articles about VBA for beginners on the Word MVP site: Macros/VBA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •