
Selecting textboxes in order the appear in doc
Hi Jon
Try changing this line
For Each s In ActiveDocument.Shapes
to this
For Each s In ActiveDocument.Range.Shapes
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email
Quote:
> Cindy
> The anchors are in the correct order, but word still selects the first
> created box first. Am I doing something wrong?
> this _should_ take each picture and put it at the start of the document,
it
> does, but in creation order not anchor order
> Sub main()
> Dim pasterange As Range
> Dim s As Shape
> Dim i As InlineShape
> Set pasterange = ActiveDocument.Range(0, 0)
> For Each s In ActiveDocument.Shapes
> If s.TextFrame.HasText Then
> For Each i In s.TextFrame.TextRange.InlineShapes
> i.Range.Copy
> pasterange.Collapse Direction:=wdCollapseEnd
> pasterange.PasteSpecial Placement:=wdInline
> Next i
> End If
> Next s
> End Sub
> > Hi Jon,
> > > I've got a doc full of text boxes, but if I itterate through them in
> turn
> > > (for i=1 to .shapes.count) it goes in the order they were inserted,
> rather
> > > than the order they appear. Is there any way to go through the
document
> by
> > > order of appearance?
> > Actually, it should go through them in the order they're ANCHORED in the
> > document. I assume you're seeing the behavior with objects that are on
the
> > same page? Move the anchors in the order you want to jump to the text
> > boxes...
> > Cindy Meister
> > INTER-Solutions, Switzerland
> > http://homepage.swissonline.ch/cindymeister
> > http://www.mvps.org/word
> > http://go.compuserve.com/MSOfficeForum
> > This reply is posted in the Newsgroup; please post any follow question
or
> > reply in the newsgroup and not by e-mail :-)