The macro below may do what you want. It sets the wrapping style of the
selected shape to Tight and the Horizontal alignment to Right - both the
width and height of the shape are set to 3". The shape will be positioned
relative to the margin.
Note:
1. If the wrapping style of the selected shape is "In line with text" when
pasted, you must insert the following code line _before_ the line "Set oShape
=…":
Selection.InlineShapes(1).ConvertToShape
2. If you want to set only the width to 3" and scale the shape
proportionally, change “msoFalse†to “msoTrue†in the line : “
LockAspectRatio = msoFalse†(the “:Height =…†line is without importance
then).
The macro:
Sub ResizeAndPositionScreenDump()
Dim oShape As Shape
Set oShape = Selection.ShapeRange(1)
With oShape
‘Change msoFalse to msoTrue to scale proportionally
.LockAspectRatio = msoFalse
.Width = InchesToPoints(3)
.Height = InchesToPoints(3)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.Left = wdShapeRight
.WrapFormat.Type = wdWrapTight
End With
End Sub
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word