Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
David[_4_] David[_4_] is offline
external usenet poster
 
Posts: 2
Default Find and Replace Table Styles

Is it possible to find and replace table styles within Word 2007? I
have a number of small tables in a section of my document that I want
to convert from using a built in table style to a custom style that I
have subsequently defined. Going into the standard Find/Replace
dialog gives options to search on paragraph styles, but not for table
styles. Is this possible, outside of opening up the XML and tweaking
things outside of Word?

Thanks for the help!

David
  #2   Report Post  
Posted to microsoft.public.word.tables
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Find and Replace Table Styles

The following macro should work:

Sub FindAndReplaceTableStyles()
Dim t As Table
For Each t In ActiveDocument.Tables
If t.Style.NameLocal = "Light Shading - Accent 3" Then
t.Style = "Medium Shading 1"
End If
Next t
End Sub

The example applies the "Medium Shading 1" style to all tables in the
*document* that are currently using the "Light Shading - Accent 3" style. Of
course, you will have to change the style names to the ones that are
relevant for you.

If you want to replace the table styles in the *selection*, use
Selection.Tables instead of ActiveDocument.Tables in the code.

See also http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"David" wrote in message
...
Is it possible to find and replace table styles within Word 2007? I
have a number of small tables in a section of my document that I want
to convert from using a built in table style to a custom style that I
have subsequently defined. Going into the standard Find/Replace
dialog gives options to search on paragraph styles, but not for table
styles. Is this possible, outside of opening up the XML and tweaking
things outside of Word?

Thanks for the help!

David





  #3   Report Post  
Posted to microsoft.public.word.tables
David[_4_] David[_4_] is offline
external usenet poster
 
Posts: 2
Default Find and Replace Table Styles

On Feb 8, 2:18*am, "Stefan Blom" wrote:
The following macro should work:


Thanks, Stefan. That did the trick. My first tentative step into
macro-izinig my default template has been taken!

David
  #4   Report Post  
Posted to microsoft.public.word.tables
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Find and Replace Table Styles

I'm glad I could help.

--
Stefan Blom
Microsoft Word MVP


"David" wrote in message
...
On Feb 8, 2:18 am, "Stefan Blom" wrote:
The following macro should work:


Thanks, Stefan. That did the trick. My first tentative step into
macro-izinig my default template has been taken!

David


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find+Replace Dialog Box, Replace with Format problem Kathy Microsoft Word Help 3 February 1st 08 04:26 AM
Find and replace won't work in a table Natalie Microsoft Word Help 10 December 8th 06 05:50 AM
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 07:48 PM
Using find and replace or macros to replace page ranges JeremyC Microsoft Word Help 7 February 13th 06 09:20 PM
Find/ Replace is auto-capping the words I want to replace with Graham Mayor Microsoft Word Help 8 January 27th 06 01:39 AM


All times are GMT +1. The time now is 11:43 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"