Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
excuse me for my english.
I want to add another value to the object returned by the getSelectedValues function and i don't know how i can do it.
This is my code:
sub ADDNULLSELECTION()
set doc = ActiveDocument
set selectedValues = doc.fields("Project_Id").getSelectedValues
// Here should be the code that adds another value to the "selectedValues" variable but i have not found the kind of object that returns the getSelectedValues function and i don't know how i can do it.
doc.fields("Project_Id").SelectValues(SelectedValues)
end sub
¿Can someone help me please?
Thanks.
Try this set of code:
sub ADDNULLSELECTION()
set doc = ActiveDocument
set selectedValues = doc.fields("Project_Id").getSelectedValues
selectedValues.add
selectedValues(selectedValues.count-1).Text= "YourValueHere"
selectedValues(selectedValues.count-1).IsNumeric = false
doc.fields("Project_Id").SelectValues selectedValues
end sub
Hope this helps!
Try this set of code:
sub ADDNULLSELECTION()
set doc = ActiveDocument
set selectedValues = doc.fields("Project_Id").getSelectedValues
selectedValues.add
selectedValues(selectedValues.count-1).Text= "YourValueHere"
selectedValues(selectedValues.count-1).IsNumeric = false
doc.fields("Project_Id").SelectValues selectedValues
end sub
Hope this helps!
Perfect!! It works!!
Thank you very much jerem!!!