Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
Can any one help me to set multiple default values in list box (Version 10).
For example, I've a field with values of A,B,C,D…I need to be selected A&D as default .
Thanks ,
Gnana
sub DefaultSelection
set f = ActiveDocument.Fields("FieldName")
set fv = f.GetNoValues 'empty array
fv.Add
fv(0).Text = "A"
fv(0).IsNumeric = false
fv.Add
fv(1).Text = "D"
fv(1).IsNumeric = false
f.SelectValues fv
end sub
Try using an OnOpen trigger in Document properties settings with action Select in field,
Product
as field and
(A|D)
as search string.
Hope this helps,
Stefan
sub DefaultSelection
set f = ActiveDocument.Fields("FieldName")
set fv = f.GetNoValues 'empty array
fv.Add
fv(0).Text = "A"
fv(0).IsNumeric = false
fv.Add
fv(1).Text = "D"
fv(1).IsNumeric = false
f.SelectValues fv
end sub
Thank you Stefan & Lucian .. It's working !
But Stefan
I have Requirement where i have to select
those customer Whose name Start with 'S'
on selection of a Button 'S'
can u help it out .
If you have a button.
Add a action, "Select in Field".
Name the Field in the Field-textbox .
In the Search string- textbox, add S*
If you want all customers that starts with S and all customers that starts with T, you can use Stefans solution...
Add ("S*"|"T*") as the searchstring in the "Select in Field" action.
Is there any possibility with out macro.