S
sysdrk
I'm trying to use a text box below a picture to create a caption for
the picture. So I create the text box, align it just below the picture
but when I group the picture and text box, the text box gets centered
in the middle of the picture. However, if I single step through the
group command, the code works (the text box is kept under the picture).
Similarly, if I plant a breakpoint on the group command and then just
Continue when the breakpoint is reached the code works.
I have to presume this is a bug. Has anyone seen anything like this?
Know of any work around? This is Word 2003.
Denis
Here's the actual code:
' Make ShapeRange out of picture and text box, align text box with
center
' of picture, shift text box down to just below picture, then group
vertshift = (pictht + tbox.ShapeRange.Height) / 2
ActiveDocument.Shapes.Range(Array(pictname,
tbox.ShapeRange.Name)).Select
Set pictext = Selection
pictext.ShapeRange.Align msoAlignLefts, False
pictext.ShapeRange.Align msoAlignMiddles, False
tbox.ShapeRange.IncrementTop vertshift
pictext.ShapeRange.Group.Select
the picture. So I create the text box, align it just below the picture
but when I group the picture and text box, the text box gets centered
in the middle of the picture. However, if I single step through the
group command, the code works (the text box is kept under the picture).
Similarly, if I plant a breakpoint on the group command and then just
Continue when the breakpoint is reached the code works.
I have to presume this is a bug. Has anyone seen anything like this?
Know of any work around? This is Word 2003.
Denis
Here's the actual code:
' Make ShapeRange out of picture and text box, align text box with
center
' of picture, shift text box down to just below picture, then group
vertshift = (pictht + tbox.ShapeRange.Height) / 2
ActiveDocument.Shapes.Range(Array(pictname,
tbox.ShapeRange.Name)).Select
Set pictext = Selection
pictext.ShapeRange.Align msoAlignLefts, False
pictext.ShapeRange.Align msoAlignMiddles, False
tbox.ShapeRange.IncrementTop vertshift
pictext.ShapeRange.Group.Select