Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My document has 210 pages, with almost every page holding a Table. Except for the data, most tables are identical. I would like to have a macro that would go to each table in the document and add a single-column row at its top; preferably with a paragraph like "This and That Text". Any guidance is appreciated. Thanks!

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Something like this?
    Code:
      Dim aTable As Table
      For Each aTable In ActiveDocument.Tables
    	aTable.Rows.Add BeforeRow:=aTable.Rows(1)
    	aTable.Rows(1).Cells.Merge
    	aTable.Rows(1).Cells(1).Range.text = "Some text"
      Next aTable
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This worked as a charm. Thanks a lot!!!

    [quote name='Andrew Lockton' post='787272' date='03-Aug-2009 00:29']Something like this?
    Code:
      Dim aTable As Table
      For Each aTable In ActiveDocument.Tables
    	aTable.Rows.Add BeforeRow:=aTable.Rows(1)
    	aTable.Rows(1).Cells.Merge
    	aTable.Rows(1).Cells(1).Range.text = "Some text"
      Next aTable
    [/quote]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •