Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 09-19-2014, 05:48 AM
gmaxey gmaxey is offline Word VBA Find Table Text Shading Colour and replace with another Windows 7 32bit Word VBA Find Table Text Shading Colour and replace with another Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

The code works. Run this code in a new document to illustrate.

Code:
Sub Color()
With ActiveDocument
  .Tables.Add Selection.Range, 5, 5
  .Tables(1).Cell(2, 3).Shading.BackgroundPatternColor = RGB(51, 51, 153)
  .Tables(1).Cell(3, 2).Shading.BackgroundPatternColor = RGB(51, 51, 153)
  ChangeLogo ActiveDocument
End With
End Sub
 Function ChangeLogo(wdDoc)
Dim oCell As Cell, oTbl As Table, oRow As Row
Dim i As Long
For Each oTbl In wdDoc.Tables
  For Each oRow In oTbl.Rows
    For Each oCell In oRow.Cells
      If oCell.Shading.BackgroundPatternColor = RGB(51, 51, 153) Then
      oCell.Shading.BackgroundPatternColor = RGB(12, 71, 157)
      End If
    Next
   Next
 Next
  
End Function
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word VBA Find Table Text Shading Colour and replace with another Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Find and Replace multiple table columns smakdown61 Word 1 08-28-2014 09:24 PM
Word VBA Find Table Text Shading Colour and replace with another Word VBA Macro to Find and Replace based on the Alt Text of an Image bennymc Word VBA 1 01-27-2014 04:23 PM
Find - Replace Macro using a table list mdw Word 0 08-01-2013 04:36 PM
Word VBA Find Table Text Shading Colour and replace with another Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft