Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I would like to generate the code required to set a bookmark with a Macro by assigning it with an action button.
I have done a similar task with Disable/Enable an expressions from the community.http://community.qlik.com/message/15234#15234
I want to replicate the same task by appplying a bookmark ID.
I though the API for this was: set myobj = ActiveDocument.SetDocBookmarkId("BM02")
But I get this error.
Wrong number of arguments or invalid property assignment: 'ActiveDocument.SetDocBookmarkId'
Look at CreateDocBookmark
Bookmark is created just trying to apply it and undo it with the button. i.e true/false type of macro once the BM02 is set.
sub ToggleContractors
set myobj = ActiveDocument.SetDocBookmarkId "BM02"
set v = ActiveDocument.GetVariable("vToggleBM") 'first create a variable
Cnt= v.getcontent.String
prop = myobj.GetProperties
if Cnt=0 then
set expr = prop.Expressions.Item(2).Item(0).Data.ExpressionData
expr.Enable = true 'enable Bookmark
v.setContent "1",true
else
set expr = prop.Expressions.Item(2).Item(0).Data.ExpressionData
expr.Enable = false 'disable Bookmark
v.setContent "0",true
end if
myobj.SetProperties prop
end sub
To apply, try RecallDocBookmark