Split Table with Heading

B

Brian

All,

I'm trying to find a solution for a friend. He has a document that contains
a very large table. Has applied a heading style to a cell in a row throughout
the document. Why, I don't know.

What I am trying to achieve is to search for the heading reference, select
the row, convert table to text, then re-apply the heading style. This way he
can then create TOC etc. However, I am failing miserably, haven't got a lot
of time to spend on this.

Below is some code I have been playing with (last of many tries).

Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 3")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
Do While Selection.Find.Execute
Selection.SelectRow
Selection.Rows.ConvertToText Separator:=wdSeparateByTabs NestedTables:=
_ True
Selection.Style = ActiveDocument.Styles("Heading 3")
Loop
End With

Any guidance would be appreciated,

Thanks,
 
R

Rob

I'm not totally clear on what you're trying to do, but your code seems to
work if you:
1. Remove the line: Selection.Find.ParagraphFormat.Borders.Shadow = False
2. Add the comma here: Separator:=wdSeparateByTabs, NestedTables:=True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top