In Word 2000 I have a macro to insert an picture that the user chooses,
select the picture , and then make the height 1" (72 pt) - keeping the width
proportional. I then want the macro to look at whether the width is greater
than 320 pt and if so, make the width exactly 320 pt - keeping the height
proportional (which means it will end up less than 1" - that's ok).
The first set of steps below work - the picture change to 1" high. The
second set of steps does not give an error message but does not do anything.
What do I need to do to make the macro resize the picture to 320 pt wide,
keeping the height proportional?
TIA,
Vivian Carroll
'SELECT & FORMAT THE PICTURE TO BE 1" HIGH - these steps work
With Selection
.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
.InlineShapes(1).Width = Selection.InlineShapes(1).Width *
72 / _
Selection.InlineShapes(1).Height
.InlineShapes(1).Height = 72
'CHANGE THE PICTURE TO BE ABOUT 3.2" WIDE IF IT IS WIDER THAN
3.2" - these steps don't work
If .InlineShapes(1).Width > 320 Then
.InlineShapes(1).Height =
Selection.InlineShapes(1).Height * 320 / _
Selection.InlineShapes(1).Width
.InlineShapes(1).Width = 320
End If
End With
End Sub
Jonathan West - 05 Jan 2005 01:36 GMT
Hi Vivian
It looks to me as if you have your unit conversions wrong. 3.2" is about
230pt, not 320pt.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
> In Word 2000 I have a macro to insert an picture that the user chooses,
> select the picture , and then make the height 1" (72 pt) - keeping the
[quoted text clipped - 34 lines]
>
> End Sub
Vivian Carroll - 06 Jan 2005 04:15 GMT
Boy do I feel stupid! Of course, that was the problem. Thanks for helping,
Jonathan!
Vivian
> Hi Vivian
>
[quoted text clipped - 39 lines]
> >
> > End Sub