Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2017, 04:42 AM
CrossReach CrossReach is offline Looking for Help with Resizing Multiple Images in a Document Windows 10 Looking for Help with Resizing Multiple Images in a Document Office 2016
Advanced Beginner
Looking for Help with Resizing Multiple Images in a Document
 
Join Date: Jun 2015
Location: In my head
Posts: 70
CrossReach is on a distinguished road
Default Looking for Help with Resizing Multiple Images in a Document

So I have this very large document with multiple images that need to be resized to fit within the margins I have set. As you can imagine going through them one by one will be very time-consuming, boring and a little frustrating.



I was wondering if there was a way to write a macro that could do that for me in one click?

Thank you for any help offered.
Reply With Quote
  #2  
Old 12-11-2017, 05:30 AM
gmayor's Avatar
gmayor gmayor is offline Looking for Help with Resizing Multiple Images in a Document Windows 10 Looking for Help with Resizing Multiple Images in a Document Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

How are the images inserted (wrapping option). Do you want to make them larger or smaller? What is the width between the margins in question? Are they all in the body of the document?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 12-02-2018, 11:03 AM
CrossReach CrossReach is offline Looking for Help with Resizing Multiple Images in a Document Windows 10 Looking for Help with Resizing Multiple Images in a Document Office 2016
Advanced Beginner
Looking for Help with Resizing Multiple Images in a Document
 
Join Date: Jun 2015
Location: In my head
Posts: 70
CrossReach is on a distinguished road
Default

The images are inserted between the text. The text being above and below. They need to be reduced as currently they are outside the margins of the document. They just need to fit inside the document, no indents or spacing applied to them.
Reply With Quote
  #4  
Old 12-02-2018, 07:53 PM
macropod's Avatar
macropod macropod is offline Looking for Help with Resizing Multiple Images in a Document Windows 7 64bit Looking for Help with Resizing Multiple Images in a Document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 could use a macro like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Sctn As Section, iShp As InlineShape, Shp As Shape, sWdth As Single, sHght As Single
For Each Sctn In ActiveDocument.Sections
  With Sctn
    With .PageSetup
      sWdth = .PageWidth - .LeftMargin - .RightMargin - .Gutter
      sHght = .PageHeight - .TopMargin - .BottomMargin
    End With
    For Each iShp In .Range.InlineShapes
      With iShp
        .LockAspectRatio = True
        If .Width > sWdth Then .Width = sWdth
        If .Height > sHght Then .Height = sHght
      End With
    Next
    For Each Shp In .Range.ShapeRange
      With Shp
        .LockAspectRatio = True
        If .Width > sWdth Then .Width = sWdth
        If .Height > sHght Then .Height = sHght
      End With
    Next
  End With
Next
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
images, macro, macros

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for Help with Resizing Multiple Images in a Document Opening all selected images, resizing images and placing them into a table. John Livewire Word VBA 1 09-15-2017 11:24 PM
Automatic resizing of images seanspotatobusiness Forum Support 1 03-02-2017 07:44 PM
Please help! Why do images and shapes disappear when resizing or moving? 0-lara-o Word 0 10-26-2016 08:45 PM
Looking for Help with Resizing Multiple Images in a Document Insert multiple images & controls into a document vanwijnen Word VBA 1 06-05-2015 06:16 AM
Looking for Help with Resizing Multiple Images in a Document Resizing all images in document ShSimpson Drawing and Graphics 1 05-10-2012 01:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:07 AM.


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