Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get bookmark name by macro

Hi all,

is it possible with macro code to get the current Bookmark name applied in a qlikview?

The aim is to catch the applied bookmark, to add a selection in field and then to replace the same bookmark with new selection (bookmark + new field selection).

Is it possible?

Thanks in advance,

Davide

2 Replies
rajeshvaswani77
Specialist III
Specialist III

Hi All,

Is it possible to pass the bookmark name and get the ID of the bookmark?

thanks,

Rajesh Vaswani

zippo_btl
Contributor II
Contributor II

sub run

  vBMMaxNum=ActiveDocument.GetVariable("vBMMaxNum").GetContent.String
dim IterNo
dim vBMID

IterNo=vBMMaxNum
DO 
if IterNo<10 then
  vBMID="BM0"&IterNo
else
  vBMID="BM"&IterNo
end if
BMName = vBMID
if ActiveDocument.GetBookmark(vBMID).Default = true then
  vBMMaxNum=IterNo
end if

  IterNo=IterNo+1
Loop While (IterNo<=2000)
  ActiveDocument.GetVariable("vBMMaxNum").SetContent vBMMaxNum, True

end sub

The idea is to loop throw possible bookmarks, checking if the bookmark exists. If the bookmark exists u can compare its name with a given name. Bookmark names must be uniq.  This method works on local pc and doesn't work in AJAX. It should work through "open in server"