
Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
> Hi,
>
[quoted text clipped - 18 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Thanks, Helmut, but your macro has the same problem. If the cursor is
within a textbox when the macro is invoked, we get the same error
message. What's odd is that I can insert a textbox manually within the
textbox. But I can't figure out how to refer to the specific textbox
I'm in. The recorded macro goes like this:
Selection.ShapeRange.Select
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal,
100, _
0, 50, 0).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
I need to know how to set the anchor to the box that the cursor is in,
as a parameter following the dimension parameters. Something like
this:
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal,
100, _
0, 50, 0, Selection.Range).Select
But Selection.Range is not right. Can you see through my blind spot?
Thanks --
--larry
Helmut Weber - 22 Apr 2007 22:20 GMT
Hi Larry,
I see. How about omitting anchor at all?
Cursor in the textbox:
Sub Test9A()
Dim x As Long
Dim y As Long
Dim w As Long
w = Selection.ShapeRange(1).Width - 50
T = Selection.ShapeRange(1).Top + 100
l = Selection.ShapeRange(1).Left + 100
h = Selection.ShapeRange(1).Height - 50
ActiveDocument.Shapes.AddTextbox _
msoTextOrientationHorizontal, l, T, w, h
End Sub
I don't know about a textbox in a textbox.
To me ist is not within the first textbox,
but positioned so that is appears to be within.
It is on another layer, so to speak.
And it is anchored to the paragraph the textbox
it was created from is anchored.
What could that be good for?

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
larrysulky@gmail.com - 23 Apr 2007 01:23 GMT
> Hi Larry,
>
> I see. How about omitting anchor at all?
Aha! That works, Helmut! I knew I was having a brain cramp! :-)
Thank you ---
---larry