Thread: [Solved] table location, table title
View Single Post
 
Old 05-24-2011, 09:10 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi pav,

For each table, you could insert a new top row, merge all cells in that row, then copy the preceding sentence into it. For example:
Code:
Dim oTbl As Table, Rng As Range
With ActiveDocument
  For Each oTbl In .Tables
    With oTbl
      Set Rng = .Range.Paragraphs.First.Previous.Range
      Rng.End = Rng.End - 1
      Rng.Cut
      Rng.Characters.Last.Delete
      .Rows.Add BeforeRow:=.Rows.First
      .Rows.First.Cells.Merge
      .Cell(1, 1).Range.Paste
    End With
  Next
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote