Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #31  
Old 05-07-2025, 12:25 PM
lil_john lil_john is offline Insert mutliple digital images on one page Windows 11 Insert mutliple digital images on one page Office 2021
Novice
 
Join Date: May 2025
Posts: 1
lil_john is on a distinguished road
Default

Awesome Macro, Thank you so much for it! 2 small questions;



How would I a buffer to the top and bottom of the image within the cell? I changed:
.TopPadding = 0
.BottomPadding = 0
But it did not resize the image to fit and cut off the bottom of the image.

Also can I get it to not draw a border on the top of the text cell?
Reply With Quote
  #32  
Old 05-07-2025, 03:07 PM
macropod's Avatar
macropod macropod is offline Insert mutliple digital images on one page Windows 10 Insert mutliple digital images on one page Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert and hide images ricecrispies Excel 8 06-18-2022 04:19 AM
Mutliple Selection List Box tbrynard01 Word 0 09-10-2019 12:56 PM
Insert images into word form lfabiof Word VBA 1 12-24-2017 09:51 PM
Programmatically insert digital signature into a Word document tinamanns Word 0 04-12-2017 01:16 PM
Insert mutliple digital images on one page Mutliple copies 167 print as one document John-N Mail Merge 5 02-19-2012 07:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft