Hi Stefan,
I would appreciate it if you would not change the subject line when
continuing a thread. Especially the way the Microsoft server has been acting
lately, doing that messes up threads in my newsreader and I can't connect
your responses to the underlying conversation/question. (It was about a year
ago that John McGhie made the same request of me. I liked to change them so
they more accurately reflected the message content, as I think you are
trying to do.)
Thanks in advance.
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
Quote:
> I discovered an error in my previous code example. If you
> want to select the first bookmark after the current
> selection, it is best to collapse the current selection to
> its end point -- otherwise the Select method will select
> the same bookmark several times (clearly undesirable!).
> In other words:
> Instead of
> Selection.Collapse Direction:=wdCollapseStart
> use
> Selection.Collapse Direction:=wdCollapseEnd
> Stefan
> >-----Original Message-----
> >The GoToNext method would be the easy way, but it doesn't
> >work properly. (It won't accept the parameter that should
> >be used according to the help file.)
> >The following sub collapses the current selection to its
> >starting position, and then creates a range whose
> starting
> >position is at the insertion point and whose end point is
> >at the end of the document. Finally, the sub tests the
> >Bookmarks collection of the range to see if there are any
> >bookmarks available.
> >Sub FindNextBookmark()
> >Dim r As Range
> >Dim b As Bookmark
> >Selection.Collapse Direction:=wdCollapseStart
> >Set r = ActiveDocument.Range(Start:=Selection.Start, _
> >End:=ActiveDocument.Content.End)
> >With r
> > If .Bookmarks.Count > 0 Then
> > Set b = .Bookmarks(1)
> > 'Now do what you want with the bookmark.
> > 'For example, select it:
> > b.Select
> > Else
> > MsgBox "There are no more bookmarks " & _
> > "in the document"
> > End If
> >End With
> >End Sub
> >>-----Original Message-----
> >>--
> >>Bob Lohse
> >>Does anyone know how to find the Next bookmark in the
> >document without
> >>explicitly specifying its' name using VBA in a macro?
> In
> >other words, if I
> >>am at insertion point A and beyond it there is a book
> >mark, I want to move
> >>the insertion point to the bookmark and read what the
> >bookmark is. If there
> >>are no more bookmarks, it should return a false.
> >>.
> >.