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 / January 2008

Tip: Looking for answers? Try searching our database.

How to show all names of bookmarks in documents?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
avkokin - 24 Jan 2008 07:44 GMT
Hello. Is it possible and if "yes" then how to show in the document
the full list of the names of the bookmarks (if they exist)? Thank you.
Helmut Weber - 24 Jan 2008 13:19 GMT
Hi Avkokin,

its so simple, I fear,
I did not understand the question:

Sub Macro34ab()
Dim oBkm As Bookmark
For Each oBkm In ActiveDocument.Bookmarks
  ActiveDocument.Range.InsertAfter oBkm.Name & vbCrLf
Next
End Sub

Signature

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000 (german versions)

avkokin - 28 Jan 2008 12:08 GMT
On Jan 24, 4:19 pm, Helmut Weber
<HelmutWe...@discussions.microsoft.com> wrote:
> Hi Avkokin,
>
[quoted text clipped - 13 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000 (german versions)

Helmut, if possible how to show these bookmarks (name of bookmarks) as
hyperlinks?
Helmut Weber - 28 Jan 2008 15:47 GMT
Hi Avkokin,

I guess you mean that:

Sub Test6666a()
Dim oBkm As Bookmark
' make sure that there is an empty paragraph
' at the doc's end
ActiveDocument.Range.InsertAfter vbCrLf
For Each oBkm In ActiveDocument.Bookmarks
  ActiveDocument.Hyperlinks.Add _
  Anchor:=ActiveDocument.Paragraphs.Last.Range, _
  SubAddress:=oBkm.Name, _
  ScreenTip:="", _
  TextToDisplay:=oBkm.Name
  ActiveDocument.Range.InsertAfter vbCrLf
Next
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
Michael Bednarek - 24 Jan 2008 13:37 GMT
>Hello. Is it possible and if "yes" then how to show in the document
>the full list of the names of the bookmarks (if they exist)? Thank you.

This might do what you want:

 Dim bmkBmk As Bookmark

 For Each bmkBmk In ActiveDocument.Bookmarks
   Debug.Print bmkBmk.Name
 Next bmkBmk

Signature

Michael Bednarek   http://mbednarek.com/   "POST NO BILLS"

avkokin - 24 Jan 2008 18:54 GMT
On Jan 24, 4:37 pm, Michael Bednarek
<mbATmbednarek....@BLACKHOLESPAM.NET> wrote:

> >Hello. Is it possible and if "yes" then how to show in the document
> >the full list of the names of the bookmarks (if they exist)? Thank you.
[quoted text clipped - 9 lines]
> --
> Michael Bednarek  http://mbednarek.com/  "POST NO BILLS"

Thank you very much.
 
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.