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,
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,