View Single Post
  #4  
Old May 13th, 2005, 09:14 PM
SongBear
external usenet poster
 
Posts: n/a
Default

Greg
Can I assume you mean aspect ratio? I can help you with that.
Aspect ratio (Google it for a better explaination, I am going to reference
only one of the several sites I “consulted” to wit:
http://www.doom9.org/index.html?/aspectratios.htm
The old NTSC value for the standard TV that we grew up with is 4:3 width to
height. This is equal to 1.33:1 (1.33 to 1). It is also generally equal to
the VGA resolution 640:480 (really 638.4:480, but who’s counting).
If you have some code that selects the shape, you can use the .Height and
..Width properties to get the aspect ratio.

My code assigned .Height to hyt and .Width to wdt (variants)

AFTER a shape is selected by your code:

With ActiveWindow.Selection.ShapeRange
hyt = .Height
wdt = .Width
Debug.Print "Height = " & hyt & " and Width = " & wdt & ". So the Aspect
Ratio is = " & wdt / hyt & ":1."
End With

(Note the debug.print code wraps in this window.)

Some of the output, copied from the Immediate pane, we

Height = 427.5 and Width = 750. So the Aspect Ratio is = 1.754386:1.
Height = 750 and Width = 750. So the Aspect Ratio is = 1:1.
Height = 392.25 and Width = 600. So the Aspect Ratio is = 1.529637:1.
Height = 562.5 and Width = 450. So the Aspect Ratio is = 0.8:1.
Height = 768 and Width = 960. So the Aspect Ratio is = 1.25:1.
Height = 720 and Width = 960. So the Aspect Ratio is = 1.333333:1.
Height = 483.75 and Width = 450. So the Aspect Ratio is = 0.9302326:1.
Height = 768 and Width = 960. So the Aspect Ratio is = 1.25:1.
Height = 750 and Width = 750. So the Aspect Ratio is = 1:1.
Height = 738 and Width = 750. So the Aspect Ratio is = 1.01626:1.
Height = 778.5 and Width = 750. So the Aspect Ratio is = 0.9633911:1.
Height = 562.5 and Width = 750. So the Aspect Ratio is = 1.333333:1.
Height = 750 and Width = 750. So the Aspect Ratio is = 1:1.
Height = 698.25 and Width = 960. So the Aspect Ratio is = 1.374866:1.
Height = 325.5 and Width = 262.5. So the Aspect Ratio is = 0.8064516:1.
Height = 900 and Width = 1200. So the Aspect Ratio is = 1.333333:1.
Height = 750 and Width = 600. So the Aspect Ratio is = 0.8:1.
Height = 600 and Width = 750. So the Aspect Ratio is = 1.25:1.
Height = 768 and Width = 960. So the Aspect Ratio is = 1.25:1.

Note: This does start with a completed personal code project of mine in
PowerPoint VBA that automatically resizes and inserts pictures from files
into slides, but with the subject of aspect ratio, I am looking up stuff and
winging it here. If anybody knows something better, please chime in.
Hope this helps.
SongBear

"Gregg" wrote:

In VBA, how do I capture the scale% of a selected graphic?

I'm trying...
iOrgScale = ActiveWindow.Selection.ShapeRange.ScaleHeight

But that obviously doesn't work.

Thanks.