Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In a VbScript macro, I'm setting a search string to a field as below:
ActiveDocument.Fields("Sales").Select ">1500"
Now I have a use case where I would like to retrieve this search string. So something like:
ActiveDocument.Fields("Sales").GetCurrentSearchString
Unfortunately, I couldn't find such method in the API.
Am I simply missing it or is there another way to achieve this?
I'm thinking to use QlikView variables as another way to do it: storing the search string into a variable and then do
ActiveDocument.Fields("Sales").Select variable_valueThanks for your help
Hi
Try like this
Sub fieldselection
set v = ActiveDocument.Variables("vDay")
ActiveDocument.Fields("Day").Select v.GetContent.String
end sub
edit:
Sub fieldselection
set v = ActiveDocument.GetVariable("vDay")
v.SetContent "123",true 'To set the value for the variable
ActiveDocument.Fields("Day").Select v.GetContent.String 'To assign the value to select
end sub
Hope it helps
Thanks Mayil
So I guess there is no "builtin" method from the API that I can use to do this?
I'll use what you propose if that's the case
Hi
There is no GetCurrentSearchString option in macro as per my knowledge..
But by the above method, you can get the search string.. by using the variable in input box or assign the value for the variable in macro itself..
If you don'e like to go for macro means, you can go through button itself..
Action ->Select in field
Field: Sales
Search String: '>='&1500
Hope it helps
Actually, I just found out that this works in a macro!
currentSearchString = ActiveDocument.Evaluate("GetFieldSelections(Sales)")