Resizing Inline Shapes

T

T. Jenkins

I've searched for help on this, but couldn't find exactly what I'm looking
for.

I'm pasting images as inline shapes in a Table. I want to resize all of
them to the same width, say 1 inch (or the equivalent in pixels). I've tried
recording a macro that does this, but am having trouble. The pasted images
may vary a little in proportions, so I want to lock proportions when I do the
resize. This is very easy within Word, but I'm having trouble doing it in
VBA.

What I'd really like is to take action on the select shape, so as soon as I
paste it, I can resize it. I had a hard time getting a "selection" option to
work, so I shifted to using the Inlineshapes collection. Below is the code I
was trying to use.

For Each ishape In ActiveDocument.InlineShapes
ishape.LockAspectRatio = msoTrue
ishape.Width = 86.4 'Number is what was recorded
Next ishape

Problem is that the aspect ratio line isn't working, and my shapes are being
distorted. Any suggestions?

Todd
 
W

Word Heretic

G'day "T. Jenkins" <[email protected]>,

Setting width height by VBA ignores the ratio setting - that is a
convenience for GUI users only. You will have to predetermine the
aspect ratio (Height / width) and ensure your finals fit this.

Eg

Height = (Height / width)
Width = 1

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


T. Jenkins reckoned:
 

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