Hello all! new to the forum and having an issue trying to scale a design properly.
All designs will be to a set height and need to be scaled proportionally on the width. This has proved to be a tougher than it seems it should be. I have tried several different things including another post suggestion i found here on the forum. As you can see below this is not a small difference and is very visually noticeable. When calculated using the formula in the script below it should come out as the correct version but is not.
This is the last option i tried and is what i am using currently,..
ActivePage.Shapes.All.CreateSelection
Dim width As Double, height As Double
Dim newWidth As Double
ActiveShape.GetSize width, height newWidth = (6.667 * width) / height ActiveSelection.SetSize newWidth, 6.667
The math is correct in this, but it does not seem to be using the calculated width correctly.
Am i missing something here?
Chenille,
It depends how your graphic is created, especially when outline is used and Outline Pen – Scale with image not ticked on.
So you can try to change Outline Pen properties – Scale with image or you can adapt your code and convert outlines to objects before scaling.
Sub Macro1()
Dim w#, h#, selr As ShapeRange, newWidth As Double
Set selr = ActivePage.Shapes.All
selr.ConvertOutlineToObject
selr.GetSize w, h
newWidth = (6.667 * w) / h
selr.SetSize newWidth, 6.667
End Sub
Best regards
Mek