Below is the snippet of code I used to extract field value from word file with fields. The fields contain data from a xml document. I need to extract 10 10 data as array(1)=10 and array(2)=10 in below image. The text 10 box 10 may have more than 2 values. I would have to the multiple values in a array. I tried split with delimiter as space, newline. It doesnt split. Then tried
left(x1,(len(x)-1)/2) and right(x1,(len(x)-1)/2)
to extract 2 values. I am new to vba in word and need help in extracting multiple values or splitting based on these boxes which seem to be a table value.
Function calcinput()
x1 = ActiveDocument.SelectContentControlsByTag("TWCAR_Nominal").Item(1).Range.Text
x2 = ActiveDocument.SelectContentControlsByTag("TWCAR_NominalUnit").Item(1).Range.Text
MsgBox x1 + s2
Above image shows the output.
Above image shows data to be extracted