none
about word bookmark? RRS feed

  • Question

  • how can i get the bookmarks?

    after added a TOC in a document, we can get the heading by the bookmark, look the below picture:

    "headingRng" var can get by bookmark's range. but the temp var is always 0.  i don't understand this.

    it is a strange thing  bother me, why can get bookmark by name but the doc.Bookmarks collection count is always zero?

    Saturday, March 15, 2014 2:56 AM

Answers

  • Because they're hidden. Try:

    With ActiveDocument.Bookmarks
      .ShowHidden = False
      MsgBox .Count
      .ShowHidden = True
      MsgBox .Count
    End With


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by sendreams Saturday, March 15, 2014 11:03 AM
    Saturday, March 15, 2014 10:10 AM

All replies