Retrieving the selected shape's height and display it in a msgbox

A

andreas

Dear Experts:

I would like to retrieve the selected shapes's/graphic's (not an
InlineShape) height and display the result in a msgbox. How is this
done by VBA?

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
 
G

Graham Mayor

Dim sCm As String
Dim sIn As String
sCm = Format(PointsToCentimeters(Selection.Range.ShapeRange(1).Height),
"#.00")
sIn = Format(PointsToInches(Selection.Range.ShapeRange(1).Height), "#.00")
MsgBox sCm & " centimeters" & vbCr & _
sIn & " inches"


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

andreas

Dim sCm As String
Dim sIn As String
sCm = Format(PointsToCentimeters(Selection.Range.ShapeRange(1).Height),
"#.00")
sIn = Format(PointsToInches(Selection.Range.ShapeRange(1).Height), "#.00")
MsgBox sCm & " centimeters" & vbCr & _
sIn & " inches"

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>







- Zitierten Text anzeigen -

Hi Graham,

thank you very much for your professional help. It works. Thank you
very much.
Regards, Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top