Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro: getting the name of the active bookmark

Hi to all.

how can I solve this problem: I have one QV application with 3 bookmarks. I have to create a pdf-report for each bookmark.

The creation of the pdf-documten works fine. I can manually set the first bookmark and create the document, then set the second bookmark & create the 2nd Document and so on. But I would make it more comfortable, by pressing one button. So my first idea was, to set the bookmark within my macro, create the pdf-file, set the 2nd bookmark, create the pdf-file, and so on. But I didn't made it, to set the Bookmark from the macro. (RecallDocBookmark)

My second Idea was to lay actions behind the button:

1. set 1st bookmark
2. create pdf
3 set 2nd bookmark
4. create pdf
5 set 3rd Bookmark
6. create pdf

'create pdf' is a macro. As the created pdf-file would be overwritten by the 2nd & 3rd 'create pdf', my idea was to get the name of the active bookmark and put it into a variable and create the pdf document with a variable file name.

But if I have a look on the API Guide for QV9 I find no solution for getting the active bookmark. GetBookmark or GetDocBookmarkNames doesn't work. Has anyone an idea, how can I do this? I'm open for other ways....

Thanks & best regards

Stefan Bockelmann

3 Replies
Not applicable
Author

I'm a little bit smarter now:

The second Idea won't work, but the 1st one works almost.
Now I made it, to set the bookmark with RecallDocBookmark. With a Messagbox I have checked, that the bookmarks are set correctly.

But later in the source, the function 'PrintReport" don't cares about the bookmark. What can I do?

best regards

S.Bockelmann

Not applicable
Author

Try this, it should work

set bm = ActiveDocument.GetBookmark("BM01")
msgbox(bm.Bookmark.Name)

Not applicable
Author

Hi Luca,

ok, that works, but I don't think that this wouldn't solve my problem with the 'PrintReport'.
The PrintReport didn't take care about my bookmark, I have set before.

Is there a way to set the options of the Report from vbScribt?

Thanks & best regards

Stefan