Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Get Adjacent Bookmarks (VSTO)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robertro - 09 Jul 2007 01:02 GMT
Hi all,

Given a bookmark within a document what's the best way of locating bookmarks
that maybe adjacent. (i.e. they share their start and end repsectively with
mine). I've noticed that the range object bookmarks collection *may* include
them but this isn't true for bookmark that also contain paragraph line
breaks. Is there a function like gotonext/previous that works. (goto next
bookmark seems to be broken)

Rob.
Russ - 09 Jul 2007 04:59 GMT
Rob,
Try
With Application.Browser
   .Target = wdBrowseBookmark
   .Next
End With
Also there is the .inrange method test for ranges
If Selection.InRange(ActiveDocument.StoryRanges(wdFootnotesStory)) Then
   MsgBox "Selection in footnotes"
End If
> Hi all,
>
[quoted text clipped - 6 lines]
>
> Rob.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Russ - 09 Jul 2007 06:41 GMT
Rob,
Sorry, I assumed that there was a wdBrowseBookMark object, but there isn't
one by that name in the Object Browser.
Although, this should would in VBA.
ActiveDocument.GoTo(What:=wdGoToBookMark, Which:=wdGoToNext)

But the .inrange method can be used to see if your bookmark ranges overlap.

> Rob,
> Try
> With Application.Browser
>     .Target = wdBrowseBookmark
No wdBrowseBookmark object, Sorry.
>     .Next
> End With
[quoted text clipped - 12 lines]
>>
>> Rob.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.