Shapes

M

mbaird

I need to set the properties of a textbox programatically to anchor to the
top of a line.

Is it possible to programatically define the line that the textbox should be
anchored to.

Thanks

Mark Baird
 
J

Jezebel

You can specify the anchor when you add the shape ---

ActiveDocument.Shapes.AddTextbox Orientation:=msoTextOrientationHorizontal,
_
Top:=0, _
Left:=0, _
Height:=100, _
Width:=100, _
Anchor:=Activedocument.Paragraphs(1).Range

I don't know of any easy way to change the anchor for an existing Shape.
(Which is annoying, since you can do it with the keyboard.) The Anchor
property itself is readonly. Best work-around I can think of is to add a new
textbox anchored where you want, then copy all the properties of the
original, then delete the original.
 
Top