addBookmark

addBookmark

BASIC / ADVANCED / PREMIUM

Inserts a bookmark into a Word document.

Description
public void addBookmark(OptionsBookmark options)

This method allows to insert bookmarks into a Word document.

This method should be called at least twice: one to open the bookmark tag (type start) and the other one to close it (type end).

One may link the generated bookmark with the addLink method to facilitate the internal navigation through the Word document contents.

Parameters

options

Option Type Description
type String The bookmark type. Possible values are "start" and "end".
name String The name that you want to give to the corresponding bookmark. This is the parameter that should be used within the addLink method to link to the bookmarked content.
Code samples

Example #1

Example #2

The resulting Word document looks like: