Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, fellows,
could anyone write, how to set AlwaysOneSelectedValue property for the ListBox in macros. Or maybe the Field itself has this option?
Thank's for the help,
Justinas
Yes, it is for the field. The code below will give you an idea. Hope this helps you.
sub a
set fld=ActiveDocument.GetField("Product")
if fld.GetValueCount(1) <> 1 then
msgbox "Please select one value first"
exit sub
end if
set fprop = fld.GetProperties
fprop.ShowAlternatives = false
fprop.OneAndOnlyOne = true
fld.SetProperties fprop
end sub
Yes, it is for the field. The code below will give you an idea. Hope this helps you.
sub a
set fld=ActiveDocument.GetField("Product")
if fld.GetValueCount(1) <> 1 then
msgbox "Please select one value first"
exit sub
end if
set fprop = fld.GetProperties
fprop.ShowAlternatives = false
fprop.OneAndOnlyOne = true
fld.SetProperties fprop
end sub
Consulta
Como se aplica este script?
Desde donde se ejecuta el llamado?
Gracias .-D
Hi,
If your requirement is to select one value always, this will help you.
1. Select any value in the listbox
2. Go to the properties of that listbox
3. On the General Tab, find the option "Always One Selected Value"
4. Mark it as enable.
5. Click on "Apply" and "Ok"
This process will enable you to select one value always from that listbox, untill you mark it as disable.
No changes will take place even you click on "Clear" button.