![]() |
|
#1
|
||||
|
||||
![]()
In the absence of a sample table, your requirement doesn't appear to make sense.
What the code appears to suggest is that if the row height is 6 point (which seems improbable) then the row is formatted as with your first set of codes, whereas if it is greater than 6 point (which seems to be the more likely scenario) it is formatted with the second set. The only difference between the two is that the second set has the text aligned to center, whereas in the first it is left aligned. Code:
Sub FormatTables() Dim oTable As Table Dim oRow As Row For Each oTable In ActiveDocument.Tables For Each oRow In oTable.Rows With oRow.Range .Font.Name = "Arial" .Font.ColorIndex = wdBlack .Font.Size = 11 .Cells.VerticalAlignment = wdCellAlignVerticalTop .HighlightColorIndex = wdYellow End With If oRow.Height <= 6 Then oRow.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft Else oRow.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter End If Next oRow Next oTable lbl_Exit: Set oRow = Nothing Set oTable = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pasting text from Excel cell into word without creating a table, and keeping the in-cell formatting | hanvyj | Excel Programming | 0 | 08-28-2015 01:15 AM |
![]() |
markand_bhatt2008 | Excel | 1 | 04-29-2013 07:46 AM |
![]() |
gib65 | Word | 1 | 06-02-2012 03:03 PM |
![]() |
Jazz43 | Word Tables | 2 | 08-19-2010 08:07 AM |
Auto-populate an MS Word table cell with text from a diff cell? | dreamrthts | Word Tables | 0 | 03-20-2009 01:49 PM |