Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can you save individual document pages as seperate word files? | Mailmerge | |||
Word 2003: Can one disable table styles? | Tables | |||
Using 3 tables within 1 document | Microsoft Word Help | |||
Document object in protected form | Tables | |||
Merge data into one document from several tables in Access. | Mailmerge |