Skip to main content
RajGaikwad
Participant
December 22, 2010
Question

InDesignBookmarks

  • December 22, 2010
  • 1 reply
  • 375 views

I am writhing below code for adding bookmarks in InDesign CS4

BMNd.Texts(1).Select()

Dim hd2 As InDesign.HyperlinkTextDestination

Dim hdd2 As InDesign.HyperlinkTextDestinations = IndDoc.HyperlinkTextDestinations

Dim indTD2 As InDesign.Text = BMNd.Texts(1)

hd2 = hdd2.Add(indTD2)

Dim BkName As String = indTD2.Contents

BkName = RemoveJunk(BkName)

hd2.Name = BkName

myBookmark2 = myBookmark.Bookmarks.Add(hd2)

But it is giving Exception as Name is already used

but in my InDesign document there is no any bookmark present

some times it is working fine

please help me

This topic has been closed for replies.

1 reply

Green4ever
Inspiring
December 22, 2010

Try the following code to add a bookmark in InDesign CS4

bkm = myDoc.bookmarks.add(myDoc.hyperlinkTextDestinations.add(textAnchorHere));

bkm.name = "give name of your bookMark";

bkm.showBookmark();