Can't use word wrap in Word 2000 macros

B

Babydoc

When I try to use the "Record New Macro" system in WD2000 to change an
in-line picture to be text-wrapped, the text wrapping options in the picture
formating dialog are grayed out. There is a tech note that describes a
similar problem (WD2000: Unable to Record Macro for Inline-to-Floating
Picture Conversion; Article ID : 209800)that says the work around is to
select the picture, cut it, then paste-special as a picture, then select it
and change the wrap option. This doesn't work (at least not in Word 2000 on
Wuindows 2000).

Is there a work around or a way to actually code this in the macro editor?
 
J

Jay Freedman

Hi Babydoc,

There's no way to do this with the macro recorder, or much else to do
with floating graphics. You have to write the macro directly in the
editor.

If you just want to convert the picture to text-wrapped (floating),
all you need is this:

If Selection.InlineShapes.Count > 0 Then
Selection.InlineShapes(1).ConvertToShape
End If

If you also want to change the size, position, or other
characteristics of the picture once it's floating, you need to assign
the result of the ConvertToShape method to a Shape object so you can
apply the changes to that object, for example:

Dim oShp As Shape
If Selection.InlineShapes.Count > 0 Then
Set oShp = Selection.InlineShapes(1).ConvertToShape
With oShp
.LockAspectRatio = msoTrue
.Width = InchesToPoints(1)
.WrapFormat.Type = wdWrapSquare
.RelativeVerticalPosition = _
wdRelativeVerticalPositionParagraph
.Top = 6 ' points
End With
End If
 

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