Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a requirement to load a table of filter values into a listbox from a spreadsheet these are in a seperate table with no common fields so isnt linked this is deliberate. These are all selected and loaded into an array with the code below (sf). I then want to set the Array contents as the current filter for another Listbox where %Key is linked to other objects. this should then filter all objects to the selected %key value. but the code isnt working !
The line thats Failing is below : is SelectValues supported in version 8.5 Or can someone point me towards my coding error ?
doc.Fields("%key").SelectValues sf
here is a simpler code example but it is still not working ...
sub setFields
set doc = ActiveDocument
set fld = doc.fields("%key")
set x = fld.GetNoValues
x.Add
x.add
x.add
x(0).text = 1
x(1).Text = 2
x(2).Text = 3
ActiveDocument.fields("%key").SelectValues x
end sub
Did you ever get an answer to this? I am running into the same problem. If the text is numeric, its fine. But as soon as its numeric, nothing that I put in the SelectValues sticks. I get no errors, it seems to be happy. I can see the values in the "x" array, but it never gets put into the field selection.
I did get it working, but i believe its a workaround to a bug in the product.
when you populate the array value you have to set both properties for x.text and x.value
I dont have the qvw handy this evening but i can check it if the above solution doesnt work
ColinR
Thanks for the information. At least I know its not something I'm doing wrong.
I couldn't get x.value to work - but I did find a work-around using ToggleSelect. I'm all set for now.
Sally