Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2018, 06:20 PM
macropod's Avatar
macropod macropod is offline Apply Picture formatting to all pictures in the word file Windows 7 64bit Apply Picture formatting to all pictures in the word file Office 2010 32bit
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

That's as simple as:


Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  For i = 1 To .Shapes.Count
    With .Shapes(i).PictureFormat
      .CropTop = CentimetersToPoints(3)
      .CropBottom = CentimetersToPoints(4)
      .CropLeft = CentimetersToPoints(1)
      .CropRight = CentimetersToPoints(2)
    End With
  Next
  For i = 1 To .InlineShapes.Count
    With .InlineShapes(i).PictureFormat
      .CropTop = CentimetersToPoints(3)
      .CropBottom = CentimetersToPoints(4)
      .CropLeft = CentimetersToPoints(1)
      .CropRight = CentimetersToPoints(2)
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
I suggest you spend a little time learning what methods are available to VBA for whatever you're trying to do.

Note: Cropping is calculated relative to the original size of the picture, not relative to whatever it may have been re-scaled to. If you've re-scaled the picture, you'll need to divide the crop factor by the rescale percentage - which could be different for the horizontal and vertical axes.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
formatting, multiple, picture



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word file with a lot of pictures. Picture size small, File size HUGE Blackcloud_9 Drawing and Graphics 1 04-10-2018 06:04 AM
Apply Picture formatting to all pictures in the word file Make a macro apply only on selected pictures Mattia Word VBA 2 11-10-2017 12:52 AM
Apply Picture formatting to all pictures in the word file Macro to apply artistic effect to selected picture in Microsoft Word 2010. staicumihai Word VBA 2 11-24-2016 01:41 AM
VBA Word Table - Select More than 1 Column at a time - Apply Formatting jc491 Word VBA 12 09-24-2015 06:03 AM
how do i apply any change to all pictures in one document greenil Word 0 06-18-2013 12:56 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:03 PM.


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