Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2015, 06:46 AM
ineedmacrohelp ineedmacrohelp is offline Help Creating Macro to Crop/Resize Images Windows 7 64bit Help Creating Macro to Crop/Resize Images Office 2010 64bit
Novice
Help Creating Macro to Crop/Resize Images
 
Join Date: Aug 2015
Posts: 2
ineedmacrohelp is on a distinguished road
Default

I ended up figuring it out in Word. The Excel thing was getting messy. Here is the code:



Code:
Sub BackupCropperResizer()
'
' BackupCropperResizer Macro
'
'
  Dim sngWidth, sngCrop As Single
 sngCrop = 3.075
 
 
 Selection.WholeStory
 
With Selection.InlineShapes(1)
 sngWidth = .Width
 With .PictureFormat
 .CropRight = sngWidth * sngCrop
 End With
 End With
 
 On Error Resume Next
 With Selection.InlineShapes(2)
 sngWidth = .Width
 With .PictureFormat
 .CropRight = sngWidth * sngCrop
 End With
 End With
 
On Error Resume Next
With Selection.InlineShapes(3)
 sngWidth = .Width
 With .PictureFormat
 .CropRight = sngWidth * sngCrop
 End With
 End With
 
 
 Dim i As Long
With ActiveDocument
 For i = 1 To .InlineShapes.Count
 With .InlineShapes(i)
 .ScaleHeight = 33
 End With
 Next i
End With
 
End Sub
I couldn't get the cropper to work in a For Loop for some reason so I cut the corner and used On Error Resume Next. For my purpose I only have three images max, so this works out fine.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Creating Macro to Crop/Resize Images Help with VBA to resize images Yuffster Word VBA 2 01-30-2015 06:05 AM
creating mirror images gib65 Excel 4 06-12-2014 06:24 AM
save as webpage without creating new images healthyman Word 3 04-15-2012 03:51 AM
Help Creating Macro to Crop/Resize Images WORD Macro - import picture - resize - position - page break - loop Nano07 Word VBA 2 11-02-2011 05:14 AM
Help Creating Macro to Crop/Resize Images Cropped screenshots - lose crop in email nadder Office 2 10-20-2010 06:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 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