Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to write a macro to write an array of values in a list box.
suppose i have an array of values like
a(0)=123
a(1)=124
a(2)=125
a(3)=126
a(4)=127
then using a macro i want to create a listbox and write array values to listbox
Any advise or suggesstions
please help...
thanks
sushi
does it have to be through macro? would doing it in the load script work?
Hi Juan,
I have to use macro. because i am calculating the array using vb script.
Thanks
sushil
The problem is u can only add a field name to a list box, so your data should be in some field (i.e column) then only it can be represenred in a list box...
for example to add field class:
set LB = ActiveDocument.ActiveSheet.CreateListBox
set BoxProp=LB.GetProperties
BoxProp.Def.Name = "Class"
LB.SetProperties BoxProp
to create a field, the script should be modified,
To add a new Line in script we have
rem ** add new line to script **
set docprop = ActiveDocument.GetProperties
docprop.Script = docprop.Script & "Load * from abc.csv;"
ActiveDocument.SetProperties docprop
try to add your array in script, give it a name and then include it in a listbox....
Regards,
Arun Goel
Hi Arun
I am also looking forward to add array to list box created by macros as you discribe it above, but i don't get it.
Help me out to fix this issue. At least how to add values to the list box via macros
Hi Suahil
I am also looking forward to add array to list box created by macros as you discribe it above, but i don't get it.
please Help me out to fix this issue. At least how to add values to the list box via macros