I need to bookmark parts of a document from the name of paragraphs but the name of a paragraph is not always a valid name for a bookmark name. I have not found on Google or MSDN an exhaustive list of limitations for bookmark names.
What special characters are forbidden?
The only thing I found is that the length must not exceed 40 characters.
If you are familiar with regular expressions, I would say it is
^(?!\d)\w{1,40}$
Where \w
refers to the range of Unicode word characters, which also contain the underscore and the digits from 0-9.
In plain English: The bookmark name must...
As stated in the comments, bookmark names beginning with an underscore are treated as hidden. They will not appear in the regular user interface, but they can be used from VBA code. It it is not possible to create bookmarks that begin with an underscore via the regular user interface, but you can do it through VBA code with Bookmarks.Add()
.