
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set actions via Macro
Hey! Via a macro i create textboxes. Now what i want to do is, to set also certain actions for this created textboxes like on click on the textbox it should set a value for a variable or run a macro. Is it possible to give the textbox such instructions?
- Tags:
- qlikview_scripting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Macro Action:
Sub Test
set MyText = ActiveDocument.ActiveSheet.CreateTextObject
set prop = MyText.GetProperties
set TextActions = prop.Layout.ActionItems
TextActions.Add
TextActions.Item(0).Type=13
set ActionParam=TextActions.Item(0).Parameters
ActionParam.Add
ActionParam.Item(0).v="Test"
MyText.SetProperties prop
End Sub
Variable Action:
Sub Test
Set MyText = ActiveDocument.ActiveSheet.CreateTextObject
set prop = MyText.GetProperties
set TextActions = prop.Layout.ActionItems
TextActions.Add
TextActions.Item(0).Type=31
set ActionParam=TextActions.Item(0).Parameters
ActionParam.Add
ActionParam.Item(0).v="Test"
ActionParam.Add
ActionParam.Item(1).v="0"
MyText.SetProperties prop
End Sub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey! Thank you this is exact this, what im looking for. How i can add this two actions within a sub? tamilarasu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prince,
Here is the code.
Sub Test
set MyText = ActiveDocument.ActiveSheet.CreateTextObject
set prop = MyText.GetProperties
set TextActions = prop.Layout.ActionItems
TextActions.Add
TextActions.Item(0).Type=13
set ActionParam=TextActions.Item(0).Parameters
ActionParam.Add
ActionParam.Item(0).v="Macro_Test"
''''MyText.SetProperties prop
TextActions.Add
TextActions.Item(1).Type=31
set ActionParam= TextActions.Item(1).Parameters
ActionParam.Add
ActionParam.Item(0).v= "Variable_Test"
ActionParam.Add
ActionParam.Item(1).v="0"
MyText.SetProperties prop
End Sub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! U are the best!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a nice day and happy weekend, Prince.
