View Single Post
 
Old 05-07-2025, 03:07 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
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

To do that, you could add a new variables declaration line with, say:
Code:
Dim sA_BPad As Single, sL_RPad As Single: sA_BPad = CentimetersToPoints(0.25): sL_RPad = CentimetersToPoints(0.5)
Use whatever values you need for the Above/Below padding and Left/Right padding.

You might also want to change 'max width for the pictures' and 'max height for the pictures' in the following two prompts to something like 'cell widths' and 'cell heights', respectively.
Code:
ColWdth = CentimetersToPoints(CSng(InputBox("What max width for the pictures, in Centimeters (e.g. " & Format(ColWdth, "0.00") & ")?")))
RwHght = CentimetersToPoints(CSng(InputBox("What max height for the pictures, in Centimeters (e.g. 5)?")))
Then change the
Code:
        With iShp
        End With
code block to:
Code:
        With iShp
          .LockAspectRatio = True
          .Width = ColWdth - sL_RPad
          If .Height > RwHght - sA_BPad Then .Height = RwHght - sA_BPad
        End With
and insert:
Code:
    .Borders(wdBorderTop).LineStyle = wdLineStyleNone
anywhere in the
Code:
  With .Rows(x + 1)
  End With
code block.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote