lockaspectratio for inlineshapes

H

hina

I'm trying to programmatically change the width of an inline shape,
after setting lockaspectratio=true. When i click on the picture i see
that the lockaspectratio box is indeed checked, but it doesnt seem to
work... the width changes independently of the height. if i manually
doubleclick on the picture and change the size, it works. does anyone
know how i can make it work through vba?
 
C

Cindy M -WordMVP-

Hi Hina,
I'm trying to programmatically change the width of an inline shape,
after setting lockaspectratio=true. When i click on the picture i see
that the lockaspectratio box is indeed checked, but it doesnt seem to
work... the width changes independently of the height. if i manually
doubleclick on the picture and change the size, it works. does anyone
know how i can make it work through vba?
As far as I know, this has never worked correctly through VBA.
ScaleWidth and ScaleHeight are usually the better bet.

If you want a specific measurement, you can use a formula like this

'New width should be 250, height should scale to that
dblPrctChange = 100*250/ActiveDocument.InlineShapes(1).width
ActiveDocument.InlineShapes(1).ScaleHeight = dblPrctChange
ActiveDocument.InlineShapes(1).ScaleWidth = dblPrctChange

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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