![]() |
|
#1
|
|||
|
|||
|
I tried to run the macro to remove captions in all tables in a document.
Code:
Sub delTableCaptionAll()
Dim ctr As Integer
Dim txt As String
Dim Check As Boolean
Dim para As Paragraph
ctr = 0
For Each para In ActiveDocument.Paragraphs
txt = para.Range.Text
Debug.Print txt
Check = InStr(txt, "Table")
Debug.Print Check
If Check = True And para.Range.Style = "Caption" Then
para.Range.Delete
End If
ctr = ctr + 1
Debug.Print ctr
Next
End Sub
Thanks |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove space between header and first bullet in Outlook email created by Excel macro | kevinbradley57 | Excel Programming | 1 | 03-27-2019 08:39 PM |
How to remove almost a full page of blank space in between Word table rows
|
garrisonsdad | Word Tables | 4 | 10-18-2018 09:09 PM |
Can't get rid of empty white space in table
|
wtfword | Word Tables | 2 | 01-24-2018 02:47 AM |
Remove consecutive empty paragraphs within existing macro
|
kevinbradley57 | Word VBA | 5 | 10-11-2017 05:04 PM |
Remove space after table in header
|
melliejane | Word | 1 | 03-05-2012 04:09 PM |