M
Mark Tangard
OK, so Word has no page object, but I need one anyway.
Is this the most efficient way to operate on all of the textboxes
whose anchors are on the current page?
Dim sh As Shape, r As Range
Set r = Selection.Range
Set r = r.GoTo(What:=wdGoToBookmark, Name:="\page")
r.Select
If r.ShapeRange.Count = 0 Then MsgBox "No shapes.": Exit Sub
For Each sh In ActiveDocument.Shapes
If sh.Type = msoTextBox Then
If sh.Anchor.InRange(r) Then _
sh.TextFrame.TextRange.InsertBefore "Z"
End If
Next
TIA
Is this the most efficient way to operate on all of the textboxes
whose anchors are on the current page?
Dim sh As Shape, r As Range
Set r = Selection.Range
Set r = r.GoTo(What:=wdGoToBookmark, Name:="\page")
r.Select
If r.ShapeRange.Count = 0 Then MsgBox "No shapes.": Exit Sub
For Each sh In ActiveDocument.Shapes
If sh.Type = msoTextBox Then
If sh.Anchor.InRange(r) Then _
sh.TextFrame.TextRange.InsertBefore "Z"
End If
Next
TIA