Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-30-2015, 03:53 AM
Yuffster Yuffster is offline Help with VBA to resize images Windows 7 64bit Help with VBA to resize images Office 2010 64bit
Novice
Help with VBA to resize images
 
Join Date: Jan 2015
Posts: 2
Yuffster is on a distinguished road
Default Help with VBA to resize images

Hi all,

I have a mail merge document for letters that need a different signature adding to different letters. I have achieved this using the includepicture mergefield function, and then adding in a macro to resize the signatures to fit the space given.

One of the signatures is too small when it is resized according to my macro, so I was wondering if I could add in an IF/THEN style argument to use a different aspect ratio for that particular signature but I am still learning with VBA so any help would be much appreciated. My original macro is as follows:

Sub ResizeSignatures()
Dim targetWidth As Integer
Dim oShp As Shape
Dim oILShp As InlineShape
targetWidth = 2.5

For Each oShp In ActiveDocument.Shapes
With oShp
.Height = AspectHt(.Width, .Height, _
CentimetersToPoints(targetWidth))
.Width = CentimetersToPoints(targetWidth)
End With


Next
For Each oILShp In ActiveDocument.InlineShapes
With oILShp
.Height = AspectHt(.Width, .Height, CentimetersToPoints(targetWidth))
.Width = CentimetersToPoints(targetWidth)
End With
Next
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert and resize image lenguyenleduong Word VBA 2 05-11-2014 07:23 AM
Shortcut for image resize Hatthans PowerPoint 0 01-06-2014 04:32 PM
Help with VBA to resize images Resize and align AndyDDUK PowerPoint 9 11-09-2012 05:23 AM
Help with VBA to resize images Resize and center tables Ulodesk Word Tables 1 06-08-2012 09:25 PM
Help with VBA to resize images Mail Mege Images - Path Correct but Images Repeated Sonia Sosa Mail Merge 8 04-22-2011 03:05 PM

Other Forums: Access Forums

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