View Single Post
 
Old 06-03-2025, 01:05 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
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

You have put the vertical alignment code in the wrong place. You don't need:
Code:
      .Range.Cells.VerticalAlignment = wdCellAlignVerticalTop
Instead of having it where you've put it, you should be using something like:
Code:
Sub FormatRows(oTbl As Table, x As Long, Hght As Single)
With oTbl
  With .Rows(x)
    .Height = Hght
    .HeightRule = wdRowHeightExactly
    .Range.Style = "TblPic"
    .Cells.VerticalAlignment = wdCellAlignVerticalCenter
  End With
  With .Rows(x + 1)
    .Height = CentimetersToPoints(0.5)
    .HeightRule = wdRowHeightAtLeast
    .Range.Style = "Caption"
    .Cells.VerticalAlignment = wdCellAlignVerticalTop
  End With
End With
Except for the new line & wdRowHeightAtLeast, that's what the code in post #1 had...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote