Reply
 
Thread Tools Display Modes
  #1   Report Post  
Tamara
 
Posts: n/a
Default Globally removing certain tables in a document


I have a certain number of tables in my document that I want to remove. They
are scattered throughout the document. The text in the tables is colored red.
If I write a macro to globally find & replace red text with nothing, it
removes the text but not the tables themselves (i.e., I end up with a bunch
of empty tables). How can I automate this process so that I can remove these
tables?

  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Tamara wrote:
I have a certain number of tables in my document that I want to
remove. They are scattered throughout the document. The text in the
tables is colored red. If I write a macro to globally find & replace
red text with nothing, it removes the text but not the tables
themselves (i.e., I end up with a bunch of empty tables). How can I
automate this process so that I can remove these tables?


Use this macro (see http://www.gmayor.com/installing_macro.htm if needed):

Sub KillRedTables()
Dim oTbl As Table

For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Font.Color = wdColorRed Then
oTbl.Delete
End If
Next oTbl
End Sub

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


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
Can you save individual document pages as seperate word files? John Calligy Mailmerge 2 April 12th 05 09:14 AM
Word 2003: Can one disable table styles? [email protected] Tables 5 April 10th 05 10:02 AM
Using 3 tables within 1 document Sandra PK Microsoft Word Help 1 December 29th 04 01:13 AM
Document object in protected form Bruce Tables 2 December 6th 04 07:09 PM
Merge data into one document from several tables in Access. Professor Wise Mailmerge 1 December 2nd 04 10:40 PM


All times are GMT +1. The time now is 09:29 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"