View Single Post
 
Old 10-07-2022, 02:29 PM
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

Try adding:
Code:
Aspect as Boolean
to:
Code:
Dim i As Long, j As Long, c As Long, r As Long, NumCols As Long, iShp As InlineShape
inserting:
Code:
Aspect = RwHght > ColWdth
before:
Code:
On Error GoTo 0
and changing:
Code:
        With iShp
          .LockAspectRatio = True
          If (.Width < ColWdth) And (.Height < RwHght) Then
            .Width = ColWdth
            If .Height > RwHght Then .Height = RwHght
          End If
        End With
Code:
        With iShp
          .LockAspectRatio = True
          If (.Height > .Width) <> Aspect Then
            Set Shp = .ConvertToShape
            Shp.Rotation = 90
            Shp.ConvertToInlineShape
          End If
        End With
        Set iShp = oTbl.Cell(r, c).Range.InlineShapes(1)
        With iShp
          If (.Width < ColWdth) And (.Height < RwHght) Then
            .Width = ColWdth
            If .Height > RwHght Then .Height = RwHght
          End If
        End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote